|
| 1 | +/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. |
| 2 | +
|
| 3 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +you may not use this file except in compliance with the License. |
| 5 | +You may obtain a copy of the License at |
| 6 | +
|
| 7 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +
|
| 9 | +Unless required by applicable law or agreed to in writing, software |
| 10 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +See the License for the specific language governing permissions and |
| 13 | +limitations under the License. |
| 14 | +==============================================================================*/ |
| 15 | + |
| 16 | +syntax = "proto2"; |
| 17 | + |
| 18 | +package tflite.task.vision; |
| 19 | + |
| 20 | +import "tensorflow/lite/experimental/acceleration/configuration/configuration.proto"; |
| 21 | +import "tensorflow_lite_support/cc/task/core/proto/base_options.proto"; |
| 22 | +import "tensorflow_lite_support/cc/task/core/proto/external_file.proto"; |
| 23 | + |
| 24 | +// Options for setting up an ObjectDetector. |
| 25 | +// Next Id: 10. |
| 26 | +message ImageTransformerOptions { |
| 27 | + // Base options for configuring Task library, such as specifying the TfLite |
| 28 | + // model file with metadata, accelerator options, etc. |
| 29 | + optional tflite.task.core.BaseOptions base_options = 9; |
| 30 | + |
| 31 | + // Legacy method for specifying the TFLite model file, as a single standalone |
| 32 | + // TFLite file packed with TFLite Model Metadata [1]. Those are mandatory, and |
| 33 | + // used to populate e.g. the label map and recommended score threshold. |
| 34 | + // |
| 35 | + // [1]: https://www.tensorflow.org/lite/convert/metadata |
| 36 | + // |
| 37 | + // Deprecated: prefer using `base_options.model_file`, which is mutually |
| 38 | + // exclusive with this field. |
| 39 | + optional core.ExternalFile model_file_with_metadata = 1; |
| 40 | + |
| 41 | + // Legacy method for specifying the number of threads to be used for TFLite |
| 42 | + // ops that support multi-threading when running inference with CPU. |
| 43 | + // num_threads should be greater than 0 or equal to -1. Setting num_threads to |
| 44 | + // -1 has the effect to let TFLite runtime set the value. |
| 45 | + // |
| 46 | + // Deprecated: only works with `model_file_with_metadata`. Prefer using |
| 47 | + // `base_options` to specifying the TFLite model and using |
| 48 | + // `base_options.compute_settings.tflite_settings.cpu_settings.num_threads`, |
| 49 | + // to configure the number of threads. |
| 50 | + optional int32 num_threads = 7 [default = -1]; |
| 51 | + |
| 52 | + // Legacy method for specifying how to accelerate the model |
| 53 | + // inference using dedicated delegates. Supported delegate type includes: |
| 54 | + // NONE, NNAPI, GPU, HEXAGON, XNNPACK, EDGETPU (Google internal), |
| 55 | + // and EDGETPU_CORAL. |
| 56 | + // |
| 57 | + // IMPORTANT: in order to use a delegate, the appropriate delegate plugin |
| 58 | + // needs to be linked at build time. See comment above the "object_detector" |
| 59 | + // target at: |
| 60 | + // https://github.com/tensorflow/tflite-support/blob/master/tensorflow_lite_support/cc/task/vision/BUILD |
| 61 | + // |
| 62 | + // See settings definition at: |
| 63 | + // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/experimental/acceleration/configuration/configuration.proto |
| 64 | + // |
| 65 | + // Deprecated: only works with `model_file_with_metadata`. Prefer using |
| 66 | + // `base_options` to specifying the TFLite model and using |
| 67 | + // `base_options.compute_settings` to configure acceleration options. |
| 68 | + optional tflite.proto.ComputeSettings compute_settings = 8; |
| 69 | +} |
0 commit comments