chromium/third_party/mediapipe/src/mediapipe/tasks/cc/core/proto/base_options.proto

/* Copyright 2022 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.tasks.core.proto;

import "mediapipe/gpu/gpu_origin.proto";
import "mediapipe/tasks/cc/core/proto/acceleration.proto";
import "mediapipe/tasks/cc/core/proto/external_file.proto";

option java_package = "com.google.mediapipe.tasks.core.proto";
option java_outer_classname = "BaseOptionsProto";

// Base options for mediapipe tasks.
// Next Id: 5
message BaseOptions {
  // The external model asset, as a single standalone TFLite file. It could be
  // packed with TFLite Model Metadata[1] and associated files if exist. Fail to
  // provide the necessary metadata and associated files might result in errors.
  // Check the documentation for each task about the specific requirement.
  // [1]: https://www.tensorflow.org/lite/convert/metadata

  optional ExternalFile model_asset = 1;

  // Whether the mediapipe task treats the input data as a continuous data
  // stream, or a batch of unrelated data. Default to False.
  optional bool use_stream_mode = 2 [default = false];

  // Acceleration setting to use available delegate on the device.
  optional Acceleration acceleration = 3;

  // Gpu origin for calculators with gpu supported.
  optional mediapipe.GpuOrigin.Mode gpu_origin = 4 [default = TOP_LEFT];
}