From 2f9c98275745b8b45647f281ff85f3af9dfa3bc6 Mon Sep 17 00:00:00 2001 From: Valeriu Lacatusu Date: Fri, 19 Jan 2018 15:42:17 +0100 Subject: [PATCH] Update detection.py Fixing lint issues --- python/mxnet/image/detection.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/mxnet/image/detection.py b/python/mxnet/image/detection.py index e5f604d4c61f..3b4ac63a10f8 100644 --- a/python/mxnet/image/detection.py +++ b/python/mxnet/image/detection.py @@ -892,17 +892,16 @@ def draw_next(self, color=None, thickness=2, mean=None, std=None, clip=True, y2 = int(label[i, 4] * height) bc = np.random.rand(3) * 255 if not color else color cv2.rectangle(image, (x1, y1), (x2, y2), bc, thickness) - if id2labels is not None: cls_id = int(label[i, 0]) if cls_id in id2labels: cls_name = id2labels[cls_id] text = "{:s}".format(cls_name) font = cv2.FONT_HERSHEY_SIMPLEX - font_scale = 0.5 text_height = cv2.getTextSize(text, font, font_scale, 2)[0][1] - cv2.putText(image, text, (x1 + 5, y1 + text_height + 5), font, 0.5, (255, 255, 255), 2) - + tc = (255, 255, 255) + tpos = (x1 + 5, y1 + text_height + 5) + cv2.putText(image, text, tpos, font, 0.5, tc, 2) if waitKey is not None: cv2.imshow(window_name, image) cv2.waitKey(waitKey)