From 4438606f3f3d5f988e8312497da8010128eb0d02 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Thu, 25 May 2023 19:08:50 +0530 Subject: [PATCH] Updated method name in iOS gesture recognizer testu utils --- .../gesture_recognizer/MPPGestureRecognizerTests.m | 11 ++++++----- .../sources/MPPGestureRecognizerResult+ProtoHelpers.h | 4 ++-- .../MPPGestureRecognizerResult+ProtoHelpers.mm | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m b/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m index ea2f92088..d457f8d18 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m @@ -74,7 +74,7 @@ static const float kLandmarksErrorTolerance = 0.03f; #define AssertGestureRecognizerResultIsEmpty(gestureRecognizerResult) \ XCTAssertTrue(gestureRecognizerResult.gestures.count == 0); \ XCTAssertTrue(gestureRecognizerResult.handedness.count == 0); \ - XCTAssertTrue(gestureRecognizerResult.landmarks.count == 0); \ + XCTAssertTrue(gestureRecognizerResult.landmarks.count == 0); \ XCTAssertTrue(gestureRecognizerResult.worldLandmarks.count == 0); @interface MPPGestureRecognizerTests : XCTestCase @@ -97,15 +97,16 @@ static const float kLandmarksErrorTolerance = 0.03f; [MPPGestureRecognizerTests filePathWithFileInfo:kExpectedThumbUpLandmarksFile]; return [MPPGestureRecognizerResult - gestureRecognizerResultsFromProtobufFileWithName:filePath - gestureLabel:kExpectedThumbUpLabel]; + gestureRecognizerResultsFromTextEncodedProtobufFileWithName:filePath + gestureLabel:kExpectedThumbUpLabel]; } + (MPPGestureRecognizerResult *)fistGestureRecognizerResultWithLabel:(NSString *)gestureLabel { NSString *filePath = [MPPGestureRecognizerTests filePathWithFileInfo:kExpectedFistLandmarksFile]; - return [MPPGestureRecognizerResult gestureRecognizerResultsFromProtobufFileWithName:filePath - gestureLabel:gestureLabel]; + return [MPPGestureRecognizerResult + gestureRecognizerResultsFromTextEncodedProtobufFileWithName:filePath + gestureLabel:gestureLabel]; } - (void)assertMultiHandLandmarks:(NSArray *> *)multiHandLandmarks diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h index 5203b4b77..9abea43e2 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h @@ -19,8 +19,8 @@ NS_ASSUME_NONNULL_BEGIN @interface MPPGestureRecognizerResult (ProtoHelpers) + (MPPGestureRecognizerResult *) - gestureRecognizerResultsFromProtobufFileWithName:(NSString *)fileName - gestureLabel:(NSString *)gestureLabel; + gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName + gestureLabel:(NSString *)gestureLabel; @end NS_ASSUME_NONNULL_END diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.mm b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.mm index 9ef283ca6..3c40bd880 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.mm +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.mm @@ -32,8 +32,8 @@ using ::mediapipe::tasks::ios::test::vision::utils::get_proto_from_pbtxt; @implementation MPPGestureRecognizerResult (ProtoHelpers) + (MPPGestureRecognizerResult *) - gestureRecognizerResultsFromProtobufFileWithName:(NSString *)fileName - gestureLabel:(NSString *)gestureLabel { + gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName + gestureLabel:(NSString *)gestureLabel { LandmarksDetectionResultProto landmarkDetectionResultProto; if (!get_proto_from_pbtxt(fileName.cppString, landmarkDetectionResultProto).ok()) {