Updated method name in iOS gesture recognizer testu utils

This commit is contained in:
Prianka Liz Kariat 2023-05-25 19:08:50 +05:30
parent 885148f50f
commit 4438606f3f
3 changed files with 10 additions and 9 deletions

View File

@ -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<NSArray<MPPNormalizedLandmark *> *> *)multiHandLandmarks

View File

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

View File

@ -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()) {