Skip to content
New issue

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

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

Already on GitHub? # to your account

I want to pass the image read by opencv to the model I/F #9913

Closed
1 task done
Heartful-echo opened this issue Oct 25, 2022 · 3 comments
Closed
1 task done

I want to pass the image read by opencv to the model I/F #9913

Heartful-echo opened this issue Oct 25, 2022 · 3 comments
Labels
question Further information is requested

Comments

@Heartful-echo
Copy link

Search before asking

Question

Hi

I want to pass the image read by opencv to the model I/F.
I wrote a simple code.

cap = cv2.VideoCapture (0)
_, img= cap.read()
results = model(img)

Even if there is a person in front of the camera, it will not be detected.
Is this code written correctly?

Additional

No response

@Heartful-echo Heartful-echo added the question Further information is requested label Oct 25, 2022
@glenn-jocher
Copy link
Member

glenn-jocher commented Oct 25, 2022

@kazuya-uchida this is incorrect usage since cv2 loads in BGR and all YOLO models expect RGB. See PyTorch Hub tutorial for correct usage examples.

Tutorials

Good luck 🍀 and let us know if you have any other questions!

@Heartful-echo
Copy link
Author

@glenn-jocher

Thank you for your advice.

@glenn-jocher
Copy link
Member

@Heartful-echo you're welcome! If you have any more questions or need further assistance, feel free to ask. We're here to help!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants