Optimize seg_bbox calculations (#19056)
This commit is contained in:
parent
5bca9341e8
commit
c5ac5548ae
1 changed files with 1 additions and 2 deletions
|
|
@ -801,9 +801,8 @@ class Annotator:
|
||||||
return
|
return
|
||||||
|
|
||||||
cv2.polylines(self.im, [np.int32([mask])], isClosed=True, color=mask_color, thickness=2)
|
cv2.polylines(self.im, [np.int32([mask])], isClosed=True, color=mask_color, thickness=2)
|
||||||
text_size, _ = cv2.getTextSize(label, 0, self.sf, self.tf)
|
|
||||||
|
|
||||||
if label:
|
if label:
|
||||||
|
text_size, _ = cv2.getTextSize(label, 0, self.sf, self.tf)
|
||||||
cv2.rectangle(
|
cv2.rectangle(
|
||||||
self.im,
|
self.im,
|
||||||
(int(mask[0][0]) - text_size[0] // 2 - 10, int(mask[0][1]) - text_size[1] - 10),
|
(int(mask[0][0]) - text_size[0] // 2 - 10, int(mask[0][1]) - text_size[1] - 10),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue