Skip to content

Commit 9bed42c

Browse files
authored
Fix coordinates range of the bounding boxes.
Coordinates of the detected bounding boxes were able to be outside of the input video resolution. So, this commit fixes to restrict the coordinates of the bounding boxes within the video resolution.
1 parent dc39204 commit 9bed42c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demos/multi_camera_multi_target_tracking_demo/python/utils/network_wrappers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def __decode_detections(self, out, frame_shape, only_target_class):
7979

8080
left = int(max(detection[3], 0) * frame_shape[1])
8181
top = int(max(detection[4], 0) * frame_shape[0])
82-
right = int(max(detection[5], 0) * frame_shape[1])
83-
bottom = int(max(detection[6], 0) * frame_shape[0])
82+
right = int(min(detection[5], 1) * frame_shape[1])
83+
bottom = int(min(detection[6], 1) * frame_shape[0])
8484
if self.expand_ratio != (1., 1.):
8585
w = (right - left)
8686
h = (bottom - top)

0 commit comments

Comments
 (0)