Updated protobuf helper method name in iOS Gesture Recognizer Helpers
This commit is contained in:
parent
086798e677
commit
dffca9e3b5
|
@ -98,18 +98,17 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
[MPPGestureRecognizerTests filePathWithFileInfo:kExpectedThumbUpLandmarksFile];
|
[MPPGestureRecognizerTests filePathWithFileInfo:kExpectedThumbUpLandmarksFile];
|
||||||
|
|
||||||
return [MPPGestureRecognizerResult
|
return [MPPGestureRecognizerResult
|
||||||
gestureRecognizerResultsFromTextEncodedProtobufFileWithName:filePath
|
gestureRecognizerResultsFromProtobufFileWithName:filePath
|
||||||
gestureLabel:kExpectedThumbUpLabel
|
gestureLabel:kExpectedThumbUpLabel
|
||||||
shouldRemoveZPosition:YES];
|
shouldRemoveZPosition:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (MPPGestureRecognizerResult *)fistGestureRecognizerResultWithLabel:(NSString *)gestureLabel {
|
+ (MPPGestureRecognizerResult *)fistGestureRecognizerResultWithLabel:(NSString *)gestureLabel {
|
||||||
NSString *filePath = [MPPGestureRecognizerTests filePathWithFileInfo:kExpectedFistLandmarksFile];
|
NSString *filePath = [MPPGestureRecognizerTests filePathWithFileInfo:kExpectedFistLandmarksFile];
|
||||||
|
|
||||||
return [MPPGestureRecognizerResult
|
return [MPPGestureRecognizerResult gestureRecognizerResultsFromProtobufFileWithName:filePath
|
||||||
gestureRecognizerResultsFromTextEncodedProtobufFileWithName:filePath
|
gestureLabel:gestureLabel
|
||||||
gestureLabel:gestureLabel
|
shouldRemoveZPosition:YES];
|
||||||
shouldRemoveZPosition:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Assert Gesture Recognizer Results
|
#pragma mark Assert Gesture Recognizer Results
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2022 The MediaPipe Authors.
|
// Copyright 2023 The MediaPipe Authors.
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
|
@ -19,9 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
@interface MPPGestureRecognizerResult (ProtobufHelpers)
|
@interface MPPGestureRecognizerResult (ProtobufHelpers)
|
||||||
|
|
||||||
+ (MPPGestureRecognizerResult *)
|
+ (MPPGestureRecognizerResult *)
|
||||||
gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName
|
gestureRecognizerResultsFromProtobufFileWithName:(NSString *)fileName
|
||||||
gestureLabel:(NSString *)gestureLabel
|
gestureLabel:(NSString *)gestureLabel
|
||||||
shouldRemoveZPosition:(BOOL)removeZPosition;
|
shouldRemoveZPosition:(BOOL)removeZPosition;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@ using ::mediapipe::tasks::ios::test::vision::utils::get_proto_from_pbtxt;
|
||||||
|
|
||||||
@implementation MPPGestureRecognizerResult (ProtobufHelpers)
|
@implementation MPPGestureRecognizerResult (ProtobufHelpers)
|
||||||
|
|
||||||
+ (MPPGestureRecognizerResult *)
|
+ (MPPGestureRecognizerResult *)gestureRecognizerResultsProtobufFileWithName:(NSString *)fileName
|
||||||
gestureRecognizerResultsFromTextEncodedProtobufFileWithName:(NSString *)fileName
|
gestureLabel:
|
||||||
gestureLabel:(NSString *)gestureLabel
|
(NSString *)gestureLabel
|
||||||
shouldRemoveZPosition:(BOOL)removeZPosition {
|
shouldRemoveZPosition:(BOOL)removeZPosition {
|
||||||
LandmarksDetectionResultProto landmarkDetectionResultProto;
|
LandmarksDetectionResultProto landmarkDetectionResultProto;
|
||||||
|
|
||||||
if (!get_proto_from_pbtxt(fileName.cppString, landmarkDetectionResultProto).ok()) {
|
if (!get_proto_from_pbtxt(fileName.cppString, landmarkDetectionResultProto).ok()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user