Skip to content

Commit

Permalink
add contrast to conf/class against bbox rectangle color
Browse files Browse the repository at this point in the history
  • Loading branch information
oakhtar147 committed Sep 18, 2020
1 parent 5a9c5c1 commit e37f51d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ def plot_one_box(x, img, color=None, label=None, line_thickness=None):
t_size = cv2.getTextSize(label, 0, fontScale=tl / 3, thickness=tf)[0]
c2 = c1[0] + t_size[0], c1[1] - t_size[1] - 3
cv2.rectangle(img, c1, c2, color, -1, cv2.LINE_AA) # filled
cv2.putText(img, label, (c1[0], c1[1] - 2), 0, tl / 3, [225, 255, 255], thickness=tf, lineType=cv2.LINE_AA)
cv2.putText(img, label, (c1[0], c1[1] - 2), 0, tl / 3, [(255 - c) for c in color], thickness=tf, lineType=cv2.LINE_AA) # add contrast of conf/class with bbox rectangle


def plot_wh_methods(): # from utils.general import *; plot_wh_methods()
Expand Down

0 comments on commit e37f51d

Please sign in to comment.