// Copyright 2021 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";
import "mediapipe/gpu/gpu_origin.proto";
message TensorsToSegmentationCalculatorOptions {
extend mediapipe.CalculatorOptions {
optional TensorsToSegmentationCalculatorOptions ext = 374311106;
}
// For CONVENTIONAL mode in OpenGL, textures start at bottom and needs
// to be flipped vertically as tensors are expected to start at top.
// (DEFAULT or unset is interpreted as CONVENTIONAL.)
optional GpuOrigin.Mode gpu_origin = 1;
// Supported activation functions for filtering.
enum Activation {
NONE = 0; // Assumes 1-channel input tensor.
SIGMOID = 1; // Assumes 1-channel input tensor.
SOFTMAX = 2; // Assumes 2-channel input tensor.
}
// Activation function to apply to input tensor.
// Softmax requires a 2-channel tensor, see output_layer_index below.
optional Activation activation = 2 [default = NONE];
// Channel to use for processing tensor.
// Only applies when using activation=SOFTMAX.
// Works on two channel input tensor only.
optional int32 output_layer_index = 3 [default = 1];
}