parser.add_argument('--source', type=str, default='0', help='source') # file/folder, 0 for webcam
发现打开摄像头出错
Traceback (most recent call last):
File "H:\PycharmProject\yolov5-5.0\detect.py", line 198, in <module>
detect()
File "H:\PycharmProject\yolov5-5.0\detect.py", line 51, in detect
dataset = LoadStreams(source, img_size=imgsz, stride=stride)
File "H:\PycharmProject\yolov5-5.0\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
Process finished with exit code 1
if 'youtube.com/' in url or 'youtu.be/' in url: # if source is YouTube video
修改为字符串型:
if 'youtube.com/' in str(url) or 'youtu.be/' in str(url): # if source is YouTube video