Renamed iOS gesture recognizer protobuf utils

This commit is contained in:
Prianka Liz Kariat 2023-05-31 20:51:43 +05:30
parent 955489d71d
commit ebeffc27eb
5 changed files with 7 additions and 14 deletions

View File

@ -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"],

View File

@ -15,7 +15,7 @@
#import <XCTest/XCTest.h>
#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); \

View File

@ -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",

View File

@ -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

View File

@ -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