From b1034740803091d3eac7e2534d1b62a53ff3456d Mon Sep 17 00:00:00 2001
From: Yanbing Dong <dongyanbing@metasota.ai>
Date: Mon, 11 Mar 2019 10:44:07 +0800
Subject: [PATCH] Mod: modify the range of bbox in BboxTransform

---
 mmdet/datasets/transforms.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mmdet/datasets/transforms.py b/mmdet/datasets/transforms.py
index 571493e..f94c072 100644
--- a/mmdet/datasets/transforms.py
+++ b/mmdet/datasets/transforms.py
@@ -76,8 +76,8 @@ class BboxTransform(object):
         gt_bboxes = bboxes * scale_factor
         if flip:
             gt_bboxes = bbox_flip(gt_bboxes, img_shape)
-        gt_bboxes[:, 0::2] = np.clip(gt_bboxes[:, 0::2], 0, img_shape[1])
-        gt_bboxes[:, 1::2] = np.clip(gt_bboxes[:, 1::2], 0, img_shape[0])
+        gt_bboxes[:, 0::2] = np.clip(gt_bboxes[:, 0::2], 0, img_shape[1] - 1)
+        gt_bboxes[:, 1::2] = np.clip(gt_bboxes[:, 1::2], 0, img_shape[0] - 1)
         if self.max_num_gts is None:
             return gt_bboxes
         else:
-- 
GitLab