mediapipe/mediapipe2/calculators/tflite/ssd_anchors_calculator.proto
2021-06-10 23:01:19 +00:00

64 lines
2.5 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";
// Options to generate anchors for SSD object detection models.
message SsdAnchorsCalculatorOptions {
extend mediapipe.CalculatorOptions {
optional SsdAnchorsCalculatorOptions ext = 247258239;
}
// Size of input images.
required int32 input_size_width = 1;
required int32 input_size_height = 2;
// Min and max scales for generating anchor boxes on feature maps.
required float min_scale = 3;
required float max_scale = 4;
// The offset for the center of anchors. The value is in the scale of stride.
// E.g. 0.5 meaning 0.5 * |current_stride| in pixels.
required float anchor_offset_x = 5 [default = 0.5];
required float anchor_offset_y = 6 [default = 0.5];
// Number of output feature maps to generate the anchors on.
required int32 num_layers = 7;
// Sizes of output feature maps to create anchors. Either feature_map size or
// stride should be provided.
repeated int32 feature_map_width = 8;
repeated int32 feature_map_height = 9;
// Strides of each output feature maps.
repeated int32 strides = 10;
// List of different aspect ratio to generate anchors.
repeated float aspect_ratios = 11;
// A boolean to indicate whether the fixed 3 boxes per location is used in the
// lowest layer.
optional bool reduce_boxes_in_lowest_layer = 12 [default = false];
// An additional anchor is added with this aspect ratio and a scale
// interpolated between the scale for a layer and the scale for the next layer
// (1.0 for the last layer). This anchor is not included if this value is 0.
optional float interpolated_scale_aspect_ratio = 13 [default = 1.0];
// Whether use fixed width and height (e.g. both 1.0f) for each anchor.
// This option can be used when the predicted anchor width and height are in
// pixels.
optional bool fixed_anchor_size = 14 [default = false];
}