Skip to content
Snippets Groups Projects
Unverified Commit 98cfd6c0 authored by 唐红艳's avatar 唐红艳 Committed by Gitee
Browse files

update research/cv/centernet_det/infer/sdk/api/visual.py.

parent 322ef912
No related branches found
No related tags found
No related merge requests found
......@@ -189,9 +189,9 @@ def visual_image(img, annos, save_path, ratio=None, height=None, width=None, nam
continue
txt = '{}{:.2f}'.format(name, ann["score"])
cat_size = cv2.getTextSize(txt, cv2.FONT_HERSHEY_SIMPLEX, 0.5, 2)[0]
cv2.rectangle(img, (bbox[0], int(bbox[1] - cat_size[1] - 5)),
cv2.rectangle(img, (int(bbox[0]), int(bbox[1] - cat_size[1] - 5)),
(int(bbox[0] + cat_size[0]), int(bbox[1] - 2)), c, -1)
cv2.putText(img, txt, (bbox[0], int(bbox[1] - 5)),
cv2.putText(img, txt, (int(bbox[0]), int(bbox[1] - 5)),
cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 0), 1, lineType=cv2.LINE_AA)
ct = (int((bbox[0] + bbox[2]) / 2), int((bbox[1] + bbox[3]) / 2))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment