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

detect_video from detecto.visualize needs to use int in cv2.rectangle #106

Open
ad2946 opened this issue Feb 16, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@ad2946
Copy link

ad2946 commented Feb 16, 2022

I tried to use the detect_video function in my code and i found that the function is using

        cv2.rectangle(frame, (box[0], box[1]), (box[2], box[3]), (255, 0, 0), 3)

        cv2.putText(frame, '{}: {}'.format(label, round(score.item(), 2)), (box[0], box[1] - 10),
                    cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0), 3)

when it should be:

        cv2.rectangle(frame, (int(box[0]), int(box[1])), (int(box[2]), int(box[3])), (255, 0, 0), 3)

        cv2.putText(frame, '{}: {}'.format(label, round(score.item(), 2)), (int(box[0]), int(box[1]) - 10),
                    cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0), 3)

Otherwise it won't work.

@ad2946 ad2946 added the bug Something isn't working label Feb 16, 2022
@tomh014
Copy link

tomh014 commented Feb 3, 2023

This fixed an issue I was having, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants