diff --git a/mediapipe/tasks/ios/test/vision/holistic_landmarker/MPPHolisticLandmarkerTests.mm b/mediapipe/tasks/ios/test/vision/holistic_landmarker/MPPHolisticLandmarkerTests.mm index d36a7d7ed5..943e76eae9 100644 --- a/mediapipe/tasks/ios/test/vision/holistic_landmarker/MPPHolisticLandmarkerTests.mm +++ b/mediapipe/tasks/ios/test/vision/holistic_landmarker/MPPHolisticLandmarkerTests.mm @@ -533,17 +533,26 @@ - (void)assertHolisticLandmarkerResult:(MPPHolisticLandmarkerResult *)holisticLa withLandmarkTypeName:@"pose_landmarks" areApproximatelyEqualToExpectedNormalizedLandmarks:expectedHolisticLandmarkerResult .poseLandmarks]; + // Comparing world landmark counts of the actual result to pose landmark counts of expected result + // to ensure world landmarks are present since expected result does not contain world landmarks. + XCTAssertEqual(holisticLandmarkerResult.poseWorldLandmarks.count, + expectedHolisticLandmarkerResult.poseLandmarks.count); [self assertNormalizedLandmarks:holisticLandmarkerResult.leftHandLandmarks withLandmarkTypeName:@"left_hand_landmarks" areApproximatelyEqualToExpectedNormalizedLandmarks:expectedHolisticLandmarkerResult .leftHandLandmarks]; + XCTAssertEqual(holisticLandmarkerResult.leftHandWorldLandmarks.count, + expectedHolisticLandmarkerResult.leftHandLandmarks.count); [self assertNormalizedLandmarks:holisticLandmarkerResult.rightHandLandmarks withLandmarkTypeName:@"right_hand_landmarks" areApproximatelyEqualToExpectedNormalizedLandmarks:expectedHolisticLandmarkerResult .rightHandLandmarks]; + XCTAssertEqual(holisticLandmarkerResult.rightHandWorldLandmarks.count, + expectedHolisticLandmarkerResult.rightHandLandmarks.count); + [self assertFaceBlendshapes:holisticLandmarkerResult.faceBlendshapes areApproximatelyEqualToExpectedFaceBlendshapes:expectedHolisticLandmarkerResult .faceBlendshapes]; diff --git a/mediapipe/tasks/ios/vision/holistic_landmarker/utils/sources/MPPHolisticLandmarkerResult+Helpers.mm b/mediapipe/tasks/ios/vision/holistic_landmarker/utils/sources/MPPHolisticLandmarkerResult+Helpers.mm index 3cf088dd65..0f202fe96b 100644 --- a/mediapipe/tasks/ios/vision/holistic_landmarker/utils/sources/MPPHolisticLandmarkerResult+Helpers.mm +++ b/mediapipe/tasks/ios/vision/holistic_landmarker/utils/sources/MPPHolisticLandmarkerResult+Helpers.mm @@ -73,7 +73,8 @@ @implementation MPPHolisticLandmarkerResult (Helpers) faceBlendshapesProto:faceBlendshapesProto poseLandmarksProto:NormalizedLandmarkListFromPacket( poseLandmarksPacket) - poseWorldLandmarksProto:LandmarkListFromPacket(poseLandmarksPacket) + poseWorldLandmarksProto:LandmarkListFromPacket( + poseWorldLandmarksPacket) poseSegmentationMaskProto:poseSegmentationMaskProto leftHandLandmarksProto:NormalizedLandmarkListFromPacket( leftHandLandmarksPacket)