Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Update detection.py
Browse files Browse the repository at this point in the history
Fixed missing variable declaration
Fixing lint issues
  • Loading branch information
lvaleriu committed Sep 12, 2018
1 parent 595c727 commit 3b34b50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/mxnet/image/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,6 @@ 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:
Expand All @@ -900,8 +899,9 @@ def draw_next(self, color=None, thickness=2, mean=None, std=None, clip=True,
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, font_scale, tc, 2)
if waitKey is not None:
cv2.imshow(window_name, image)
cv2.waitKey(waitKey)
Expand Down

0 comments on commit 3b34b50

Please sign in to comment.