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.

126 lines
5.0 KiB

6 years ago
  1. syntax = "proto2";
  2. package object_detection.protos;
  3. // Configuration proto for defining input readers that generate Object Detection
  4. // Examples from input sources. Input readers are expected to generate a
  5. // dictionary of tensors, with the following fields populated:
  6. //
  7. // 'image': an [image_height, image_width, channels] image tensor that detection
  8. // will be run on.
  9. // 'groundtruth_classes': a [num_boxes] int32 tensor storing the class
  10. // labels of detected boxes in the image.
  11. // 'groundtruth_boxes': a [num_boxes, 4] float tensor storing the coordinates of
  12. // detected boxes in the image.
  13. // 'groundtruth_instance_masks': (Optional), a [num_boxes, image_height,
  14. // image_width] float tensor storing binary mask of the objects in boxes.
  15. // Instance mask format. Note that PNG masks are much more space efficient.
  16. enum InstanceMaskType {
  17. DEFAULT = 0; // Default implementation, currently NUMERICAL_MASKS
  18. NUMERICAL_MASKS = 1; // [num_masks, H, W] float32 binary masks.
  19. PNG_MASKS = 2; // Encoded PNG masks.
  20. }
  21. // Next id: 25
  22. message InputReader {
  23. // Name of input reader. Typically used to describe the dataset that is read
  24. // by this input reader.
  25. optional string name = 23 [default=""];
  26. // Path to StringIntLabelMap pbtxt file specifying the mapping from string
  27. // labels to integer ids.
  28. optional string label_map_path = 1 [default=""];
  29. // Whether data should be processed in the order they are read in, or
  30. // shuffled randomly.
  31. optional bool shuffle = 2 [default=true];
  32. // Buffer size to be used when shuffling.
  33. optional uint32 shuffle_buffer_size = 11 [default = 2048];
  34. // Buffer size to be used when shuffling file names.
  35. optional uint32 filenames_shuffle_buffer_size = 12 [default = 100];
  36. // The number of times a data source is read. If set to zero, the data source
  37. // will be reused indefinitely.
  38. optional uint32 num_epochs = 5 [default=0];
  39. // Integer representing how often an example should be sampled. To feed
  40. // only 1/3 of your data into your model, set `sample_1_of_n_examples` to 3.
  41. // This is particularly useful for evaluation, where you might not prefer to
  42. // evaluate all of your samples.
  43. optional uint32 sample_1_of_n_examples = 22 [default=1];
  44. // Number of file shards to read in parallel.
  45. optional uint32 num_readers = 6 [default=64];
  46. // Number of batches to produce in parallel. If this is run on a 2x2 TPU set
  47. // this to 8.
  48. optional uint32 num_parallel_batches = 19 [default=8];
  49. // Number of batches to prefetch. Prefetch decouples input pipeline and
  50. // model so they can be pipelined resulting in higher throughput. Set this
  51. // to a small constant and increment linearly until the improvements become
  52. // marginal or you exceed your cpu memory budget. Setting this to -1,
  53. // automatically tunes this value for you.
  54. optional int32 num_prefetch_batches = 20 [default=2];
  55. // Maximum number of records to keep in reader queue.
  56. optional uint32 queue_capacity = 3 [default=2000, deprecated=true];
  57. // Minimum number of records to keep in reader queue. A large value is needed
  58. // to generate a good random shuffle.
  59. optional uint32 min_after_dequeue = 4 [default=1000, deprecated=true];
  60. // Number of records to read from each reader at once.
  61. optional uint32 read_block_length = 15 [default=32];
  62. // Number of decoded records to prefetch before batching.
  63. optional uint32 prefetch_size = 13 [default = 512, deprecated=true];
  64. // Number of parallel decode ops to apply.
  65. optional uint32 num_parallel_map_calls = 14 [default = 64, deprecated=true];
  66. // If positive, TfExampleDecoder will try to decode rasters of additional
  67. // channels from tf.Examples.
  68. optional int32 num_additional_channels = 18 [default = 0];
  69. // Number of groundtruth keypoints per object.
  70. optional uint32 num_keypoints = 16 [default = 0];
  71. // Maximum number of boxes to pad to during training / evaluation.
  72. // Set this to at least the maximum amount of boxes in the input data,
  73. // otherwise some groundtruth boxes may be clipped.
  74. optional int32 max_number_of_boxes = 21 [default=100];
  75. // Whether to load multiclass scores from the dataset.
  76. optional bool load_multiclass_scores = 24 [default = false];
  77. // Whether to load groundtruth instance masks.
  78. optional bool load_instance_masks = 7 [default = false];
  79. // Type of instance mask.
  80. optional InstanceMaskType mask_type = 10 [default = NUMERICAL_MASKS];
  81. // Whether to use the display name when decoding examples. This is only used
  82. // when mapping class text strings to integers.
  83. optional bool use_display_name = 17 [default = false];
  84. oneof input_reader {
  85. TFRecordInputReader tf_record_input_reader = 8;
  86. ExternalInputReader external_input_reader = 9;
  87. }
  88. }
  89. // An input reader that reads TF Example protos from local TFRecord files.
  90. message TFRecordInputReader {
  91. // Path(s) to `TFRecordFile`s.
  92. repeated string input_path = 1;
  93. }
  94. // An externally defined input reader. Users may define an extension to this
  95. // proto to interface their own input readers.
  96. message ExternalInputReader {
  97. extensions 1 to 999;
  98. }