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

WARNING Environment does not support cv2.imshow() or PIL Image.show() #9844

Closed
1 task done
aleksandr-sokolov opened this issue Oct 18, 2022 · 12 comments · Fixed by #9847
Closed
1 task done

WARNING Environment does not support cv2.imshow() or PIL Image.show() #9844

aleksandr-sokolov opened this issue Oct 18, 2022 · 12 comments · Fixed by #9847
Labels
question Further information is requested

Comments

@aleksandr-sokolov
Copy link

Search before asking

Question

When trying to run the "python detect.py --source 0" script I get WARNING Environment does not support cv2.imshow() or PIL Image.show(). The script runs, but I don't get a window with a view of the real time object detection work.

Has anyone experienced this and what solutions could you advise me on?

My environment:

  • YOLOv5 torch-1.12.1+cu116 CUDA:0 (GeForce GTX 1050, 4096MiB)
  • Python-3.10.8
  • OS: Windows 10

screenshot

Thank you in advance

Alex

Additional

No response

@aleksandr-sokolov aleksandr-sokolov added the question Further information is requested label Oct 18, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2022

👋 Hello @aleksandr-sokolov, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

@aleksandr-sokolov thanks for the bug report! I'm able to reproduce, I'll investigate a fix.

Screenshot 2022-10-18 at 21 57 53

@glenn-jocher glenn-jocher added the TODO High priority items label Oct 18, 2022
@glenn-jocher glenn-jocher removed the TODO High priority items label Oct 18, 2022
@glenn-jocher
Copy link
Member

glenn-jocher commented Oct 18, 2022

@aleksandr-sokolov good news 😃! Your original issue may now be fixed ✅ in PR #9847.

To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Run on Gradient Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

@aleksandr-sokolov
Copy link
Author

aleksandr-sokolov commented Oct 18, 2022

@glenn-jocher thank you so much for the quick response and for fixing this issue. Everything is working perfectly now!
You are the best! 😃😃😃

@glenn-jocher
Copy link
Member

@aleksandr-sokolov great!

@mlongoria1
Copy link

Hello, I am very new to yolov5 and have been experimenting for the past week or so. This project worked previously and then yesterday or the day before I cloned the repo again and it showed the symptoms discussed here on this issue. I will update the code with git pull to get the changes and give it a try.

But, I just wanted to say, for me(being a newbie) I never would have seen the WARNING text. It shows up for a short while during startup and then disappears off the screen while the source is set to webcam or ipcam with a URL.

Because of this, I was wondering if you could implement a WARNING that is in yellow font color so it is more noticeable for newbies and pros alike. Or if it would be possible to add the WARNING to show up in the LOGGER output maybe every 10,15, or 20 lines or so which ever seems more appropriate? This way as the logger is being displayed "live" and people will realize there is an issue/warning with the current run of the program?

During the streaming of video from ipcam I would never have seen this warning easily, all I would see is the endless lines of logger info that keeps displaying until I shut down the python script.

Here is a sample of color-coded output and the lines where the warning could show up every 10 lines or so.

FDuxBxui3f

Thank you

@glenn-jocher
Copy link
Member

@mlongoria1 thanks for the feedback!

@nilanshu24
Copy link

@glenn-jocher the issue stays the same with me, can someone help?
I'm getting the same error that @aleksandr-sokolov mentioned. It has not been resolved yet i tried to clone the repository again.

@scraus
Copy link

scraus commented Jan 4, 2023

Hello, @glenn-jocher! I also got the same error @aleksandr-sokolov mentioned though I have cloned the recent yolov5 version already...

@glenn-jocher
Copy link
Member

@scraus @Patricia-Olivera Thanks for reaching out. We appreciate your patience as we work to resolve this issue. We'll investigate and update you as soon as possible.

@Ahmet-Ruchan
Copy link

"I was experiencing the same issue. I found the solution on this link. You can go and solve your problem there too."

https://stackoverflow.com/questions/50783177/opencv-the-function-is-not-implemented-rebuild-the-library-with-windows

@glenn-jocher
Copy link
Member

@Ahmet-Ruchan i'm glad to hear you found a solution that worked for you. However, please note that we generally recommend referring to our official documentation for guidance on using YOLOv5 to ensure compatibility and up-to-date information. If you encounter any further issues or have questions, feel free to reach out here or check our documentation at the Ultralytics Docs. Happy detecting! 🚀

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

Successfully merging a pull request may close this issue.

6 participants