diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/BUILD b/mediapipe/tasks/ios/test/vision/gesture_recognizer/BUILD index 5be17a26c..6b53c9005 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/BUILD +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/BUILD @@ -42,7 +42,7 @@ objc_library( "//mediapipe/tasks/ios/common:MPPCommon", "//mediapipe/tasks/ios/test/vision/utils:MPPImageTestUtils", "//mediapipe/tasks/ios/vision/gesture_recognizer:MPPGestureRecognizer", - "//mediapipe/tasks/ios/test/vision/gesture_recognizer/utils:MPPGestureRecognizerResultProtoHelpers", + "//mediapipe/tasks/ios/test/vision/gesture_recognizer/utils:MPPGestureRecognizerResultProtobufHelpers", ] + select({ "//third_party:opencv_ios_sim_arm64_source_build": ["@ios_opencv_source//:opencv_xcframework"], "//third_party:opencv_ios_arm64_source_build": ["@ios_opencv_source//:opencv_xcframework"], diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m b/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m index 1a48322b4..2fb2c8a5b 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/MPPGestureRecognizerTests.m @@ -15,7 +15,7 @@ #import #import "mediapipe/tasks/ios/common/sources/MPPCommon.h" -#import "mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h" +#import "mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtobufHelpers.h" #import "mediapipe/tasks/ios/test/vision/utils/sources/MPPImage+TestUtils.h" #import "mediapipe/tasks/ios/vision/gesture_recognizer/sources/MPPGestureRecognizer.h" @@ -64,13 +64,6 @@ static const float kLandmarksErrorTolerance = 0.03f; XCTAssertEqualWithAccuracy(landmark.y, expectedLandmark.y, kLandmarksErrorTolerance, \ @"hand index = %d landmark index j = %d", handIndex, landmarkIndex); -#define AssertApproximatelyEqualMultiHandLandmarks(multiHandLandmarks, expectedMultiHandLandmars) \ - XCTAssertEqual(multiHandLandmarks.count, expectedMultiHandLandmars.count) \ - XCTAssertEqualWithAccuracy(landmark.x, expectedLandmark.x, kLandmarksErrorTolerance, \ - @"hand index = %d landmark index j = %d", handIndex, handIndex); \ - XCTAssertEqualWithAccuracy(landmark.y, expectedLandmark.y, kLandmarksErrorTolerance, \ - @"hand index = %d landmark index j = %d", handIndex, handIndex); - #define AssertGestureRecognizerResultIsEmpty(gestureRecognizerResult) \ XCTAssertTrue(gestureRecognizerResult.gestures.count == 0); \ XCTAssertTrue(gestureRecognizerResult.handedness.count == 0); \ diff --git a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/BUILD b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/BUILD index ddac21ed2..584d3e441 100644 --- a/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/BUILD +++ b/mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/BUILD @@ -3,9 +3,9 @@ package(default_visibility = ["//mediapipe/tasks:internal"]) licenses(["notice"]) objc_library( - name = "MPPGestureRecognizerResultProtoHelpers", - srcs = ["sources/MPPGestureRecognizerResult+ProtoHelpers.mm"], - hdrs = ["sources/MPPGestureRecognizerResult+ProtoHelpers.h"], + name = "MPPGestureRecognizerResultProtobufHelpers", + srcs = ["sources/MPPGestureRecognizerResult+ProtobufHelpers.mm"], + hdrs = ["sources/MPPGestureRecognizerResult+ProtobufHelpers.h"], copts = [ "-ObjC++", "-std=c++17", 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+ProtobufHelpers.h similarity index 95% rename from mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.h rename to mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtobufHelpers.h index 6bb2e5182..cfa0a5e53 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+ProtobufHelpers.h @@ -16,7 +16,7 @@ #import "mediapipe/tasks/ios/vision/gesture_recognizer/sources/MPPGestureRecognizerResult.h" NS_ASSUME_NONNULL_BEGIN -@interface MPPGestureRecognizerResult (ProtoHelpers) +@interface MPPGestureRecognizerResult (ProtobufHelpers) + (MPPGestureRecognizerResult *) gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName 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+ProtobufHelpers.mm similarity index 98% rename from mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtoHelpers.mm rename to mediapipe/tasks/ios/test/vision/gesture_recognizer/utils/sources/MPPGestureRecognizerResult+ProtobufHelpers.mm index ce3a262b8..a4f6de5e1 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+ProtobufHelpers.mm @@ -29,7 +29,7 @@ using LandmarksDetectionResultProto = using ::mediapipe::tasks::ios::test::vision::utils::get_proto_from_pbtxt; } // anonymous namespace -@implementation MPPGestureRecognizerResult (ProtoHelpers) +@implementation MPPGestureRecognizerResult (ProtobufHelpers) + (MPPGestureRecognizerResult *) gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName