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

Now with FPS > 0, cmd wont end #3220

Closed
424124 opened this issue May 18, 2021 · 4 comments · Fixed by #3277
Closed

Now with FPS > 0, cmd wont end #3220

424124 opened this issue May 18, 2021 · 4 comments · Fixed by #3277
Labels
bug Something isn't working

Comments

@424124
Copy link

424124 commented May 18, 2021

So after I followed instructions on how to fix #3196 by git pull, I get proper stream with FPS.
but when I close the stream by typing 'q', it cant fully complete or close.

I get:

c:\OG\yolov5>python detect.py --source 0
Namespace(weights='yolov5s.pt', source='0', img_size=640, conf_thres=0.6, iou_thres=0.45, device='', view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, update=False, project='runs/detect', name='exp', exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False)
YOLOv5 v5.0-91-g17b0f71 torch 1.8.1+cpu CPU

Fusing layers...
Model Summary: 224 layers, 7266973 parameters, 0 gradients
1/1: 0... success (-1 frames 640x480 at 30.00 FPS).

0: 480x640 1 car, Done. (0.259s)
0: 480x640 1 car, Done. (0.265s)
0: 480x640 1 car, Done. (0.260s)
0: 480x640 1 car, Done. (0.267s)
0: 480x640 1 car, Done. (0.267s)
0: 480x640 1 car, Done. (0.258s)
0: 480x640 1 car, Done. (0.263s)
0: 480x640 1 car, Done. (0.262s)
0: 480x640 1 car, Done. (0.261s)
Results saved to runs\detect\exp
Done. (10.545s)

its stuck after it Done, command prompt doesnt move, save file in exp doesnt exist, cant close or interrupt the command in cmd

@424124 424124 added the bug Something isn't working label May 18, 2021
@glenn-jocher
Copy link
Member

glenn-jocher commented May 18, 2021

@424124 you might need to interrupt with CTRL C.

@424124
Copy link
Author

424124 commented May 18, 2021

@glenn-jocher i tried to interrupt but nothing happens, only way to do anything else is to close that command prompt and start a new one

@glenn-jocher
Copy link
Member

@424124 as far as I know the only sources with termination problems are youtube videos. We don't have a force stop at the end of the video yet based on framecount, and the cv2 cap object can't determine when the video has ended.

Normal videos should all end correctly.

glenn-jocher added a commit that referenced this issue May 21, 2021
Properly terminates YouTube streams on video end. Should resolve issues #2769 and #3220.
@glenn-jocher glenn-jocher linked a pull request May 21, 2021 that will close this issue
glenn-jocher added a commit that referenced this issue May 21, 2021
* YouTube stream ending fix

Properly terminates YouTube streams on video end. Should resolve issues #2769 and #3220.

* Update datasets.py
@glenn-jocher
Copy link
Member

@424124 good news 😃! Your original issue may now be fixed ✅ in PR #3277. This PR updates the streamloader class to properly detect stopped daemon threads and results in correct conclusion of YouTube video inference. To receive this update you can:

  • git pull from within your yolov5/ directory
  • git clone https://github.com/ultralytics/yolov5 again
  • Force-reload PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • View our updated notebooks: Open In Colab Open In Kaggle

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 🚀!

Lechtr pushed a commit to Lechtr/yolov5 that referenced this issue Jul 20, 2021
* YouTube stream ending fix

Properly terminates YouTube streams on video end. Should resolve issues ultralytics#2769 and ultralytics#3220.

* Update datasets.py

(cherry picked from commit 683cefe)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this issue Aug 26, 2022
* YouTube stream ending fix

Properly terminates YouTube streams on video end. Should resolve issues ultralytics#2769 and ultralytics#3220.

* Update datasets.py
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

Successfully merging a pull request may close this issue.

2 participants