post_processing.proto 2.99 KB
Newer Older
1
2
3
4
syntax = "proto2";

package object_detection.protos;

5
6
import "object_detection/protos/calibration.proto";

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Configuration proto for non-max-suppression operation on a batch of
// detections.
message BatchNonMaxSuppression {
  // Scalar threshold for score (low scoring boxes are removed).
  optional float score_threshold = 1 [default = 0.0];

  // Scalar threshold for IOU (boxes that have high IOU overlap
  // with previously selected boxes are removed).
  optional float iou_threshold = 2 [default = 0.6];

  // Maximum number of detections to retain per class.
  optional int32 max_detections_per_class = 3 [default = 100];

  // Maximum number of detections to retain across all classes.
  optional int32 max_total_detections = 5 [default = 100];
22
23
24

  // Whether to use the implementation of NMS that guarantees static shapes.
  optional bool use_static_shapes = 6 [default = false];
25
26
27
28
29
30
31
32
33
34
35
36
37
38

  // Whether to use class agnostic NMS.
  // Class-agnostic NMS function implements a class-agnostic version
  // of Non Maximal Suppression where if max_classes_per_detection=k,
  // 1) we keep the top-k scores for each detection and
  // 2) during NMS, each detection only uses the highest class score for sorting.
  // 3) Compared to regular NMS, the worst runtime of this version is O(N^2)
  // instead of O(KN^2) where N is the number of detections and K the number of
  // classes.
  optional bool use_class_agnostic_nms = 7 [default = false];

  // Number of classes retained per detection in class agnostic NMS.

  optional int32 max_classes_per_detection = 8 [default = 1];
pkulzc's avatar
pkulzc committed
39
40
41

  // Soft NMS sigma parameter; Bodla et al, https://arxiv.org/abs/1704.04503)
  optional float soft_nms_sigma = 9 [default = 0.0];
Pooya Davoodi's avatar
Pooya Davoodi committed
42

43
44
45
  // Whether to use partitioned version of non_max_suppression.
  optional bool use_partitioned_nms = 10 [default = false];

Pooya Davoodi's avatar
Pooya Davoodi committed
46
  // Whether to use tf.image.combined_non_max_suppression.
47
  optional bool use_combined_nms = 11 [default = false];
48
49
50
51

  // Whether to change coordinate frame of the boxlist to be relative to
  // window's frame.
  optional bool change_coordinate_frame = 12 [default = true];
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
}

// Configuration proto for post-processing predicted boxes and
// scores.
message PostProcessing {
  // Non max suppression parameters.
  optional BatchNonMaxSuppression batch_non_max_suppression = 1;

  // Enum to specify how to convert the detection scores.
  enum ScoreConverter {
    // Input scores equals output scores.
    IDENTITY = 0;

    // Applies a sigmoid on input scores.
    SIGMOID = 1;

    // Applies a softmax on input scores
    SOFTMAX = 2;
  }

  // Score converter to use.
  optional ScoreConverter score_converter = 2 [default = IDENTITY];
Vivek Rathod's avatar
Vivek Rathod committed
74
75
76
77
  // Scale logit (input) value before conversion in post-processing step.
  // Typically used for softmax distillation, though can be used to scale for
  // other reasons.
  optional float logit_scale = 3 [default = 1.0];
78
79
80
  // Calibrate score outputs. Calibration is applied after score converter
  // and before non max suppression.
  optional CalibrationConfig calibration_config = 4;
81
}