Revert "Added support to set delegates in MPPBaseOptions"

This reverts commit 1e1693d9aa.
This commit is contained in:
Prianka Liz Kariat 2023-05-24 20:25:45 +05:30
parent 8f1a56f3c2
commit 1aa44abcab
3 changed files with 1 additions and 34 deletions

View File

@ -16,17 +16,6 @@
NS_ASSUME_NONNULL_BEGIN
/**
* MediaPipe Tasks delegate.
*/
typedef NS_ENUM(NSUInteger, MPPDelegate) {
/** CPU. */
MPPDelegateCPU,
/** GPU. */
MPPDelegateGPU
} NS_SWIFT_NAME(Delegate);
/**
* Holds the base options that is used for creation of any type of task. It has fields with
* important information acceleration configuration, TFLite model source etc.
@ -34,17 +23,9 @@ NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(BaseOptions)
@interface MPPBaseOptions : NSObject <NSCopying>
/**
* The absolute path to a model asset file (a tflite model or a model asset bundle file) stored in the app bundle.
*/
/** The path to the model asset to open and mmap in memory. */
@property(nonatomic, copy) NSString *modelAssetPath;
/**
* Device delegate to run the MediaPipe pipeline. If the delegate is not set, the default
* delegate CPU is used.
*/
@property(nonatomic) MPPDelegate delegate;
@end
NS_ASSUME_NONNULL_END

View File

@ -28,7 +28,6 @@
MPPBaseOptions *baseOptions = [[MPPBaseOptions alloc] init];
baseOptions.modelAssetPath = self.modelAssetPath;
baseOptions.delegate = self.delegate;
return baseOptions;
}

View File

@ -33,19 +33,6 @@ using BaseOptionsProto = ::mediapipe::tasks::core::proto::BaseOptions;
if (self.modelAssetPath) {
baseOptionsProto->mutable_model_asset()->set_file_name(self.modelAssetPath.UTF8String);
}
switch (self.delegate) {
case MPPDelegateCPU: {
baseOptionsProto->mutable_acceleration()->mutable_tflite();
break;
}
case MPPDelegateGPU: {
baseOptionsProto->mutable_acceleration()->mutable_gpu();
break;
}
default:
break;
}
}
@end