"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "3b174527f84334cfe66aae2994f59dc957bf1b3f"
Commit cd700eaf authored by Vivek Rathod's avatar Vivek Rathod Committed by TF Object Detection Team
Browse files

Make ClipWindow with Combined work with batch size > 1.

PiperOrigin-RevId: 393480597
parent 7dcd3f6b
...@@ -402,10 +402,10 @@ def _clip_boxes(boxes, clip_window): ...@@ -402,10 +402,10 @@ def _clip_boxes(boxes, clip_window):
window. window.
""" """
ymin, xmin, ymax, xmax = tf.unstack(boxes, axis=-1) ymin, xmin, ymax, xmax = tf.unstack(boxes, axis=-1)
clipped_ymin = tf.maximum(ymin, clip_window[:, 0]) clipped_ymin = tf.maximum(ymin, clip_window[:, 0, tf.newaxis])
clipped_xmin = tf.maximum(xmin, clip_window[:, 1]) clipped_xmin = tf.maximum(xmin, clip_window[:, 1, tf.newaxis])
clipped_ymax = tf.minimum(ymax, clip_window[:, 2]) clipped_ymax = tf.minimum(ymax, clip_window[:, 2, tf.newaxis])
clipped_xmax = tf.minimum(xmax, clip_window[:, 3]) clipped_xmax = tf.minimum(xmax, clip_window[:, 3, tf.newaxis])
return tf.stack([clipped_ymin, clipped_xmin, clipped_ymax, clipped_xmax], return tf.stack([clipped_ymin, clipped_xmin, clipped_ymax, clipped_xmax],
axis=-1) axis=-1)
......
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