chromium/third_party/mediapipe/src/mediapipe/calculators/tflite/tflite_tensors_to_landmarks_calculator.proto

// 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.

// The option proto for the TfLiteTensorsToLandmarksCalculator.

syntax = "proto2";

package mediapipe;

import "mediapipe/framework/calculator.proto";

message TfLiteTensorsToLandmarksCalculatorOptions {
  extend .mediapipe.CalculatorOptions {
    optional TfLiteTensorsToLandmarksCalculatorOptions ext = 257405002;
  }

  enum Activation {
    NONE = 0;
    SIGMOID = 1;
  }

  // Number of landmarks from the output of the model.
  optional int32 num_landmarks = 1;  // required

  // Size of the input image for the model. These options are used only when
  // normalized landmarks are needed. Z coordinate is scaled as X assuming
  // a weak perspective projection camera model.
  optional int32 input_image_width = 2;
  optional int32 input_image_height = 3;

  // Whether the detection coordinates from the input tensors should be flipped
  // vertically (along the y-direction). This is useful, for example, when the
  // input tensors represent detections defined with a coordinate system where
  // the origin is at the top-left corner, whereas the desired detection
  // representation has a bottom-left origin (e.g., in OpenGL).
  optional bool flip_vertically = 4 [default = false];

  // Whether the detection coordinates from the input tensors should be flipped
  // horizontally (along the x-direction). This is useful, for example, when the
  // input image is horizontally flipped in ImageTransformationCalculator
  // beforehand.
  optional bool flip_horizontally = 6 [default = false];

  // A value that Z coordinates should be divided by. This option is used only
  // when normalized landmarks are needed. It is applied in addition to Z
  // coordinate being re-scaled as X.
  optional float normalize_z = 5 [default = 1.0];

  // Apply activation function to the tensor representing landmark visibility.
  optional Activation visibility_activation = 7 [default = NONE];

  // Apply activation function to the tensor representing landmark presence.
  optional Activation presence_activation = 8 [default = NONE];
}