Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When object detection returns a large number of detection boxes, drawing boxes is very time-consuming. Is there any method[Feature] #2766

Open
xiao-song2022 opened this issue May 13, 2024 · 0 comments

Comments

@xiao-song2022
Copy link

xiao-song2022 commented May 13, 2024

Motivation

as title, i use cdk to infer and draw boxes using

def draw_bbox(frame, bboxes, labels, score_thr):

frame_copy = frame.copy()
for bbox, label_id in zip(bboxes, labels):
    [left, top, right, bottom], score = bbox[0:4].astype(int),  bbox[4]
    if score < score_thr:
        continue
    english_label = label_mapping[label_id]
    cv2.rectangle(frame_copy, (left, top), (right, bottom), (0, 255, 0), 2)
    cv2.putText(frame_copy, f'{english_label}: {score:.2f}', (int(bbox[0]), int(bbox[1])), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2, cv2.LINE_AA)
return frame_copy`

Related resources

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant