54 lines
1.7 KiB
Protocol Buffer
54 lines
1.7 KiB
Protocol Buffer
// Copyright 2019 The MediaPipe Authors.
|
|
//
|
|
// 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.
|
|
|
|
syntax = "proto2";
|
|
|
|
package mediapipe;
|
|
|
|
import "mediapipe/framework/calculator.proto";
|
|
|
|
// Full Example:
|
|
//
|
|
// node {
|
|
// calculator: "TfLiteInferenceCalculator"
|
|
// input_stream: "TENSOR_IN:image_tensors"
|
|
// output_stream: "TENSOR_OUT:result_tensors"
|
|
// options {
|
|
// [mediapipe.TfLiteInferenceCalculatorOptions.ext] {
|
|
// model_path: "model.tflite"
|
|
// use_gpu: true
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
message TfLiteInferenceCalculatorOptions {
|
|
extend mediapipe.CalculatorOptions {
|
|
optional TfLiteInferenceCalculatorOptions ext = 233867213;
|
|
}
|
|
|
|
// Path to the TF Lite model (ex: /path/to/modelname.tflite).
|
|
// On mobile, this is generally just modelname.tflite.
|
|
optional string model_path = 1;
|
|
|
|
// Whether the TF Lite GPU or CPU backend should be used. Effective only when
|
|
// input tensors are on CPU. For input tensors on GPU, GPU backend is always
|
|
// used.
|
|
optional bool use_gpu = 2 [default = false];
|
|
|
|
// Android only. When true, an NNAPI delegate will be used for inference.
|
|
// If NNAPI is not available, then the default CPU delegate will be used
|
|
// automatically.
|
|
optional bool use_nnapi = 3 [default = false];
|
|
}
|