Commit d3c73c21 authored by Vighnesh Birodkar's avatar Vighnesh Birodkar Committed by TF Object Detection Team
Browse files

Add image_and_boxes_tensor to helper doc string.

PiperOrigin-RevId: 364895608
parent f540d472
...@@ -208,14 +208,6 @@ class DetectionFromTFExampleModule(DetectionInferenceModule): ...@@ -208,14 +208,6 @@ class DetectionFromTFExampleModule(DetectionInferenceModule):
_decode_tf_example) _decode_tf_example)
return self._run_inference_on_images(images, true_shapes) return self._run_inference_on_images(images, true_shapes)
DETECTION_MODULE_MAP = {
'image_tensor': DetectionFromImageModule,
'encoded_image_string_tensor':
DetectionFromEncodedImageModule,
'tf_example': DetectionFromTFExampleModule,
'float_image_tensor': DetectionFromFloatImageModule
}
def export_inference_graph(input_type, def export_inference_graph(input_type,
pipeline_config, pipeline_config,
...@@ -355,6 +347,11 @@ class DetectionFromImageAndBoxModule(DetectionInferenceModule): ...@@ -355,6 +347,11 @@ class DetectionFromImageAndBoxModule(DetectionInferenceModule):
return self._run_segmentation_on_images(input_tensor, boxes) return self._run_segmentation_on_images(input_tensor, boxes)
DETECTION_MODULE_MAP.update({ DETECTION_MODULE_MAP = {
'image_tensor': DetectionFromImageModule,
'encoded_image_string_tensor':
DetectionFromEncodedImageModule,
'tf_example': DetectionFromTFExampleModule,
'float_image_tensor': DetectionFromFloatImageModule,
'image_and_boxes_tensor': DetectionFromImageAndBoxModule, 'image_and_boxes_tensor': DetectionFromImageAndBoxModule,
}) }
...@@ -31,6 +31,11 @@ specified option. ...@@ -31,6 +31,11 @@ specified option.
* `tf_example`: Accepts a 1-D string tensor of shape [None] containing * `tf_example`: Accepts a 1-D string tensor of shape [None] containing
serialized TFExample protos. Image resolutions are expected to be the same serialized TFExample protos. Image resolutions are expected to be the same
if more than 1 image is provided. if more than 1 image is provided.
* `image_and_boxes_tensor`: Accepts a 4-D image tensor of size
[1, None, None, 3] and a boxes tensor of size [1, None, 4] of normalized
bounding boxes. To be able to support this option, the model needs
to implement a predict_masks_from_boxes method. See the documentation
for DetectionFromImageAndBoxModule for details.
and the following output nodes returned by the model.postprocess(..): and the following output nodes returned by the model.postprocess(..):
* `num_detections`: Outputs float32 tensors of the form [batch] * `num_detections`: Outputs float32 tensors of the form [batch]
...@@ -107,7 +112,8 @@ FLAGS = flags.FLAGS ...@@ -107,7 +112,8 @@ FLAGS = flags.FLAGS
flags.DEFINE_string('input_type', 'image_tensor', 'Type of input node. Can be ' flags.DEFINE_string('input_type', 'image_tensor', 'Type of input node. Can be '
'one of [`image_tensor`, `encoded_image_string_tensor`, ' 'one of [`image_tensor`, `encoded_image_string_tensor`, '
'`tf_example`, `float_image_tensor`]') '`tf_example`, `float_image_tensor`, '
'`image_and_boxes_tensor`]')
flags.DEFINE_string('pipeline_config_path', None, flags.DEFINE_string('pipeline_config_path', None,
'Path to a pipeline_pb2.TrainEvalPipelineConfig config ' 'Path to a pipeline_pb2.TrainEvalPipelineConfig config '
'file.') 'file.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment