Skip to content

Commit

Permalink
Merge pull request #5702 from priankakariatyml:ios-holistic-landmarke…
Browse files Browse the repository at this point in the history
…r-fixes

PiperOrigin-RevId: 691072874
  • Loading branch information
copybara-github committed Oct 29, 2024
2 parents 6f742b6 + 7571b1b commit 26899ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ @implementation MPPHolisticLandmarkerResult (Helpers)
faceBlendshapesProto:faceBlendshapesProto
poseLandmarksProto:NormalizedLandmarkListFromPacket(
poseLandmarksPacket)
poseWorldLandmarksProto:LandmarkListFromPacket(poseLandmarksPacket)
poseWorldLandmarksProto:LandmarkListFromPacket(
poseWorldLandmarksPacket)
poseSegmentationMaskProto:poseSegmentationMaskProto
leftHandLandmarksProto:NormalizedLandmarkListFromPacket(
leftHandLandmarksPacket)
Expand Down

0 comments on commit 26899ed

Please sign in to comment.