"tests/vscode:/vscode.git/clone" did not exist on "9dc1600b05ecf60fab556599b4c0bc6c32837449"
Commit f82ff3b3 authored by Abdullah Rashwan's avatar Abdullah Rashwan Committed by A. Unique TensorFlower
Browse files

Copybara import of the project:

--
8a30da7c by Srihari Humbarwadi <sriharihumbarwadi97@gmail.com>:

remove normalization/denomalization in postprocess_ops

PiperOrigin-RevId: 394707702
parent 8ceeb6b3
...@@ -270,6 +270,11 @@ def _generate_detections_batched(boxes, scores, max_total_size, ...@@ -270,6 +270,11 @@ def _generate_detections_batched(boxes, scores, max_total_size,
`valid_detections` boxes are valid detections. `valid_detections` boxes are valid detections.
""" """
with tf.name_scope('generate_detections'): with tf.name_scope('generate_detections'):
# TODO(tsungyi): Removes normalization/denomalization once the
# tf.image.combined_non_max_suppression is coordinate system agnostic.
# Normalizes maximum box cooridinates to 1.
normalizer = tf.reduce_max(boxes)
boxes /= normalizer
(nmsed_boxes, nmsed_scores, nmsed_classes, (nmsed_boxes, nmsed_scores, nmsed_classes,
valid_detections) = tf.image.combined_non_max_suppression( valid_detections) = tf.image.combined_non_max_suppression(
boxes, boxes,
...@@ -279,7 +284,9 @@ def _generate_detections_batched(boxes, scores, max_total_size, ...@@ -279,7 +284,9 @@ def _generate_detections_batched(boxes, scores, max_total_size,
iou_threshold=nms_iou_threshold, iou_threshold=nms_iou_threshold,
score_threshold=score_threshold, score_threshold=score_threshold,
pad_per_class=False, pad_per_class=False,
clip_boxes=False) )
# De-normalizes box cooridinates.
nmsed_boxes *= normalizer
nmsed_classes = tf.cast(nmsed_classes, tf.int32) nmsed_classes = tf.cast(nmsed_classes, tf.int32)
return nmsed_boxes, nmsed_scores, nmsed_classes, valid_detections return nmsed_boxes, nmsed_scores, nmsed_classes, valid_detections
......
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