Separated task options protocol

This commit is contained in:
Prianka Liz Kariat 2022-12-14 11:28:21 +05:30
parent ee230520da
commit dea0e21aec
5 changed files with 39 additions and 16 deletions

View File

@ -25,7 +25,6 @@ objc_library(
"-std=c++17",
],
deps = [
"//mediapipe/framework:calculator_options_cc_proto",
":MPPBaseOptions",
],
)
@ -74,3 +73,11 @@ objc_library(
srcs = ["sources/MPPBaseOptions.m"],
hdrs = ["sources/MPPBaseOptions.h"],
)
objc_library(
name = "MPPTaskOptionsProtocol",
hdrs = ["sources/MPPTaskOptionsProtocol.h"],
deps = [
"//mediapipe/framework:calculator_options_cc_proto",
],
)

View File

@ -10,7 +10,6 @@
limitations under the License.
==============================================================================*/
#import <Foundation/Foundation.h>
#include "mediapipe/framework/calculator_options.pb.h"
#import "mediapipe/tasks/ios/core/sources/MPPBaseOptions.h"
NS_ASSUME_NONNULL_BEGIN
@ -43,16 +42,4 @@ NS_SWIFT_NAME(TaskOptions)
@end
/**
* Any mediapipe task options should confirm to this protocol.
*/
@protocol MPPTaskOptionsProtocol
/**
* Copies the iOS Mediapipe task options to an object of mediapipe::CalculatorOptions proto.
*/
- (void)copyToProto:(mediapipe::CalculatorOptions *)optionsProto;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,29 @@
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#import <Foundation/Foundation.h>
#include "mediapipe/framework/calculator_options.pb.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Any mediapipe task options should confirm to this protocol.
*/
@protocol MPPTaskOptionsProtocol
/**
* Copies the iOS Mediapipe task options to an object of mediapipe::CalculatorOptions proto.
*/
- (void)copyToProto:(mediapipe::CalculatorOptions *)optionsProto;
@end
NS_ASSUME_NONNULL_END

View File

@ -23,8 +23,8 @@ objc_library(
deps = [
"//mediapipe/tasks/ios/text/text_classifier:MPPTextClassifierOptions",
"//mediapipe/tasks/ios/core/utils:MPPBaseOptionsHelpers",
"//mediapipe/tasks/ios/core:MPPTaskOptionsProtocol",
"//mediapipe/tasks/ios/components/processors/utils:MPPClassifierOptionsHelpers",
"//mediapipe/tasks/cc/text/text_classifier/proto:text_classifier_graph_options_cc_proto",
"//mediapipe/framework:calculator_options_cc_proto",
],
)

View File

@ -12,8 +12,8 @@
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "mediapipe/framework/calculator_options.pb.h"
#import "mediapipe/tasks/ios/text/text_classifier/sources/MPPTextClassifierOptions.h"
#import "mediapipe/tasks/ios/core/sources/MPPTaskOptionsProtocol.h"
NS_ASSUME_NONNULL_BEGIN