Merge pull request #4433 from priankakariatyml:ios-remove-delegate

PiperOrigin-RevId: 533472159
This commit is contained in:
Copybara-Service 2023-05-19 09:24:26 -07:00
commit a6457d87b2
3 changed files with 0 additions and 32 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.
@ -37,12 +26,6 @@ NS_SWIFT_NAME(BaseOptions)
/** 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,20 +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: {
// TODO: Provide an implementation for GPU Delegate.
[NSException raise:@"Invalid value for delegate" format:@"GPU Delegate is not implemented."];
break;
}
default:
break;
}
}
@end