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

why i can't use webcam for real-time detect #2868

Closed
cartoonkeng opened this issue Apr 20, 2021 · 5 comments
Closed

why i can't use webcam for real-time detect #2868

cartoonkeng opened this issue Apr 20, 2021 · 5 comments
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@cartoonkeng
Copy link

cartoonkeng commented Apr 20, 2021

❔Question

I try to use 'python3 detect.py --source 0' for webcam detect but it's not work
it give me output like this

 1/1: 0... Traceback (most recent call last):
  File "detect.py", line 178, in <module>
    detect()
  File "detect.py", line 51, in detect
    dataset = LoadStreams(source, img_size=imgsz, stride=stride)
  File "/home/caton/yolov5/utils/datasets.py", line 279, in __init__
    if 'youtube.com/' in url or 'youtu.be/' in url:  # if source is YouTube video
TypeError: argument of type 'int' is `not iterable

Anyone know how to fix it?

Additional context

@cartoonkeng cartoonkeng added the question Further information is requested label Apr 20, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2021

👋 Hello @cartoonkeng, 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://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

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

CI CPU testing

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

@josenxx
Copy link

josenxx commented Apr 20, 2021

I have the same issue on ubuntu 20.04 LTS and the errror message is the same.

Update 1: webcam works fine on MAC
Update 2:
Pytorch 1.8.1 + ubuntu = webcam does not work
Pytorch 1.9 + ubuntu = webcam does not work
Pytorch 1.8.1 + mac = webcam works
Pytorch 1.9 + mac = webcam works

It seems to be a ubuntu issue

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 20, 2021

@josenxx @cartoonkeng this is a bug due to YouTube integration which was fixed in #2818. Please git pull or git clone to receive this update and let us know if you have any other issues or feedback. Thank you!

@glenn-jocher glenn-jocher added the duplicate This issue or pull request already exists label Apr 20, 2021
@glenn-jocher
Copy link
Member

@josenxx @cartoonkeng closing as duplicate of issue #2810.

Please review existing issues prior to opening new ones, thank you!

@cartoonkeng
Copy link
Author

Thank you all a lot I'll try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants