You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.5 KiB

  1. syntax = "proto2";
  2. package object_detection.protos;
  3. import "object_detection/protos/calibration.proto";
  4. // Configuration proto for non-max-suppression operation on a batch of
  5. // detections.
  6. message BatchNonMaxSuppression {
  7. // Scalar threshold for score (low scoring boxes are removed).
  8. optional float score_threshold = 1 [default = 0.0];
  9. // Scalar threshold for IOU (boxes that have high IOU overlap
  10. // with previously selected boxes are removed).
  11. optional float iou_threshold = 2 [default = 0.6];
  12. // Maximum number of detections to retain per class.
  13. optional int32 max_detections_per_class = 3 [default = 100];
  14. // Maximum number of detections to retain across all classes.
  15. optional int32 max_total_detections = 5 [default = 100];
  16. // Whether to use the implementation of NMS that guarantees static shapes.
  17. optional bool use_static_shapes = 6 [default = false];
  18. // Whether to use class agnostic NMS.
  19. // Class-agnostic NMS function implements a class-agnostic version
  20. // of Non Maximal Suppression where if max_classes_per_detection=k,
  21. // 1) we keep the top-k scores for each detection and
  22. // 2) during NMS, each detection only uses the highest class score for sorting.
  23. // 3) Compared to regular NMS, the worst runtime of this version is O(N^2)
  24. // instead of O(KN^2) where N is the number of detections and K the number of
  25. // classes.
  26. optional bool use_class_agnostic_nms = 7 [default = false];
  27. // Number of classes retained per detection in class agnostic NMS.
  28. optional int32 max_classes_per_detection = 8 [default = 1];
  29. }
  30. // Configuration proto for post-processing predicted boxes and
  31. // scores.
  32. message PostProcessing {
  33. // Non max suppression parameters.
  34. optional BatchNonMaxSuppression batch_non_max_suppression = 1;
  35. // Enum to specify how to convert the detection scores.
  36. enum ScoreConverter {
  37. // Input scores equals output scores.
  38. IDENTITY = 0;
  39. // Applies a sigmoid on input scores.
  40. SIGMOID = 1;
  41. // Applies a softmax on input scores
  42. SOFTMAX = 2;
  43. }
  44. // Score converter to use.
  45. optional ScoreConverter score_converter = 2 [default = IDENTITY];
  46. // Scale logit (input) value before conversion in post-processing step.
  47. // Typically used for softmax distillation, though can be used to scale for
  48. // other reasons.
  49. optional float logit_scale = 3 [default = 1.0];
  50. // Calibrate score outputs. Calibration is applied after score converter
  51. // and before non max suppression.
  52. optional CalibrationConfig calibration_config = 4;
  53. }