-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
Allow preview resize in detect.py #8318
Allow preview resize in detect.py #8318
Conversation
e425515
to
a8fd35c
Compare
@RyanHir thanks for the PR! If windows are exceeding screen size then the simplest solution would be to constrain show sizes to screen sizes while maintaining aspect ratio. It's preferable to automatically solve problems rather than introducing additional parameters that can manually solve them. Can you update this PR to:
Thanks! |
Hello @glenn-jocher , in the original commit i added a new parameter to change the window size. However i removed this shortly after as i realized you can tell OpenCV to allow user resize events. Please look at the changes in the latest commit as it is a single line change. |
@RyanHir oh nice, very minimal. Is this suitable for running multiple times though, i.e. for a webcam do we want this line to run 30 times per second? |
I do not believe this to cause frame rate issues as the drawing to screen is handled by the underlying system libraries. However, I have not tested for performance loss. |
As for the call running multiple times, from what I read this is required for OpenCV. |
@RyanHir tested on macOS, saw no difference in speed or functionality (can resize window with master already). On Ubuntu it's the case that master can't resize the window but with PR you can? |
Correct. Resizing is disabled by default from what I have seen. |
@RyanHir ok got it! Thanks for the feedback! PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
* Initial implementation of --viewsz * use mouse resize * Add comment Co-authored-by: Glenn Jocher <[email protected]>
This change is purely visual. Currently when running the detect.py script with a high resolution video, it will open a preview windows which may be bigger than the screen that the content is being viewed on.
This PR is simply resizing the content after annotation if the user requests the preview to be resized.This PR will allow for the preview to be resized by dragging.Tested on Ubuntu 20.04
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhanced display flexibility during image detection in YOLOv5.
📊 Key Changes
detect.py
script that enables window resizing for image displays on Linux systems.🎯 Purpose & Impact