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

python detect.py --source 0 (webcam) not working #199

Closed
maximereder opened this issue Jul 17, 2022 · 1 comment
Closed

python detect.py --source 0 (webcam) not working #199

maximereder opened this issue Jul 17, 2022 · 1 comment

Comments

@maximereder
Copy link

Hello,

I'm trying to use my webcam to do object detection. I'm using the yolov7 weight.

Command used :
python detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source 0

Error :

YOLOR 🚀 v0.1-28-g6bc5a4d torch 1.11.0 CPU

Fusing layers... 
RepConv.fuse_repvgg_block
RepConv.fuse_repvgg_block
RepConv.fuse_repvgg_block
Model Summary: 306 layers, 36905341 parameters, 6652669 gradients
 Convert model to Traced-model... 
 traced_script_module saved! 
 model is traced! 

1/1: 0... Traceback (most recent call last):
  File "/Users/maximereder/Documents/project/yolo/yolov7/detect.py", line 184, in <module>
    detect()
  File "/Users/maximereder/Documents/project/yolo/yolov7/detect.py", line 55, in detect
    dataset = LoadStreams(source, img_size=imgsz, stride=stride)
  File "/Users/maximereder/Documents/project/yolo/yolov7/utils/datasets.py", line 285, 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```
@raymondben
Copy link
Contributor

Change https://github.com/WongKinYiu/yolov7/blob/main/utils/datasets.py#L285
to

if 'youtube.com/' in str(url) or 'youtu.be/' in str(url):  # if source is YouTube video

raymondben added a commit to raymondben/yolov7 that referenced this issue Jul 18, 2022
@raymondben raymondben mentioned this issue Jul 18, 2022
AlexeyAB pushed a commit that referenced this issue Jul 21, 2022
AlexeyAB added a commit that referenced this issue Jul 22, 2022
* export end2end onnx model

* fixbug

* add web demo (#58)

* Update README.md

* main code

update yolov7-tiny deploy cfg

* main code

update yolov7-tiny training cfg

* main code

@liguagua752109150 #33 (comment)

* main code

@albertfaromatics #35 (comment)

* main code

update link

* main code

add custom hyp

* main code

update default activation function

* main code

update path

* main figure

add more tasks

* main code

update readme

* main code

update reparameterization

* Update README.md

* main code

update readme

* main code

update aux training

* main code

update aux training

* main code

update aux training

* main figure

update yolov7 prediction

* main code

update readme

* main code

rename

* main code

rename

* main code

rename

* main code

rename

* main code

update readme

* main code

update visualization

* main code

fix gain for train_aux

* main code

update loss

* main code

update instance segmentation demo

* main code

update keypoint detection demo

* main code

update pose demo

* main code

update pose

* main code

update pose

* main code

update pose

* main code

update pose

* main code

update trace

* Update README.md

* main code

fix ciou

* main code

fix nan of aux training #250 (comment) @hudingding

* support onnx to tensorrt convert (#114)

* fuse IDetect (#148)

* Fixes #199 (#203)

* minor fix

* resolve conflict

* resolve conflict

* resolve conflict

* resolve conflict

* resolve conflict

* resolve

* resolve

* resolve

* resolve

Co-authored-by: AK391 <81195143+AK391@users.noreply.github.com>
Co-authored-by: Alexey <AlexeyAB@users.noreply.github.com>
Co-authored-by: Kin-Yiu, Wong <102582011@cc.ncu.edu.tw>
Co-authored-by: linghu8812 <36389436+linghu8812@users.noreply.github.com>
Co-authored-by: Alexander <84590713+SashaAlderson@users.noreply.github.com>
Co-authored-by: Ben Raymond <ben@theraymonds.org>
Co-authored-by: AlexeyAB84 <alexeyab84@gmail.com>
wheemyungshin-nota pushed a commit to wheemyungshin/yolov7 that referenced this issue Dec 1, 2023
wheemyungshin-nota pushed a commit to wheemyungshin/yolov7 that referenced this issue Dec 1, 2023
* export end2end onnx model

* fixbug

* add web demo (WongKinYiu#58)

* Update README.md

* main code

update yolov7-tiny deploy cfg

* main code

update yolov7-tiny training cfg

* main code

@liguagua752109150 WongKinYiu#33 (comment)

* main code

@albertfaromatics WongKinYiu#35 (comment)

* main code

update link

* main code

add custom hyp

* main code

update default activation function

* main code

update path

* main figure

add more tasks

* main code

update readme

* main code

update reparameterization

* Update README.md

* main code

update readme

* main code

update aux training

* main code

update aux training

* main code

update aux training

* main figure

update yolov7 prediction

* main code

update readme

* main code

rename

* main code

rename

* main code

rename

* main code

rename

* main code

update readme

* main code

update visualization

* main code

fix gain for train_aux

* main code

update loss

* main code

update instance segmentation demo

* main code

update keypoint detection demo

* main code

update pose demo

* main code

update pose

* main code

update pose

* main code

update pose

* main code

update pose

* main code

update trace

* Update README.md

* main code

fix ciou

* main code

fix nan of aux training WongKinYiu#250 (comment) @hudingding

* support onnx to tensorrt convert (WongKinYiu#114)

* fuse IDetect (WongKinYiu#148)

* Fixes WongKinYiu#199 (WongKinYiu#203)

* minor fix

* resolve conflict

* resolve conflict

* resolve conflict

* resolve conflict

* resolve conflict

* resolve

* resolve

* resolve

* resolve

Co-authored-by: AK391 <81195143+AK391@users.noreply.github.com>
Co-authored-by: Alexey <AlexeyAB@users.noreply.github.com>
Co-authored-by: Kin-Yiu, Wong <102582011@cc.ncu.edu.tw>
Co-authored-by: linghu8812 <36389436+linghu8812@users.noreply.github.com>
Co-authored-by: Alexander <84590713+SashaAlderson@users.noreply.github.com>
Co-authored-by: Ben Raymond <ben@theraymonds.org>
Co-authored-by: AlexeyAB84 <alexeyab84@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants