当前位置:网站首页>yolov5+usb相机
yolov5+usb相机
2022-08-10 02:15:00 【jingzilideniu】
yolov5-6.0detect.py
中
parser.add_argument('--source', type=str, default= '0', help='file/dir/URL/glob, 0 for webcam') #mydata2/images/val
报错1:
TypeError: return func(*args, **kwargs)
unsupported operand type(s) for *=: 'NoneType' and 'int'
参考yolov5开笔记本摄像头实时检测方法修改,
原dataset.s
print(f'{
i + 1}/{
n}: {
s}... ', end='')
if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video
check_requirements(('pafy', 'youtube_dl'))
import pafy
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam
注销掉
依然报错1.1:TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'
或者改为
print(f'{
i + 1}/{
n}: {
s}... ', end='')
url = eval(s) if s.isnumeric() else s
if 'youtube.com/' in str(url) or 'youtu.be/' in str(url): # if 'youtube.com/' in s or 'youtu.be/' in s:
check_requirements(('pafy', 'youtube_dl'))
import pafy
url = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
报错1.2:
assert cap.isOpened(), f'Failed to open {
s}'
AssertionError: Failed to open 0
yolov5-5.0
依然是,修改datasets.py中
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):
报错:
shape = img.shape[:2] # current shape [height, width]
AttributeError: 'NoneType' object has no attribute 'shape'
可能 usb相机 不能超过640,我重新买一个。
买的480P相机可以正常运行。
如果1080p的相机的化,考虑 是否是训练时 就要修改尺寸 ,且 用下面的模型进行训练。
边栏推荐
- What makes training multi-modal classification networks hard?
- Nacos源码分析专题(五)-Nacos小结
- liunx PS1 设置
- SQLserver adds a judgment
- 2022.8.9 Remainder of Exam Balance--1000 Question Solutions
- 【语义分割】2022-HRViT CVPR
- MySQL:日志系统介绍 | 错误日志 | 查询日志 | 二进制日志:bin-log数据恢复实践 | 慢日志查询
- 2022.8.8 exam sweeps the horse (sweeper) antithesis
- 2020.11.22考试哥德巴赫猜想题解
- 《GB39707-2020》PDF下载
猜你喜欢
随机推荐
【Image Classification】2022-ConvMixer ICLR
The IDEA to automatically generate the serialVersionUID
2022.8.8考试从记忆中写入(memory)题解
6 common plugin recommendations in Pycharm
[Red Team] ATT&CK - Self-starting - Self-starting mechanism using LSA authentication package
Little rookie Hebei Unicom induction training essay
2022.8.8考试清洁工老马(sweeper)题解
ImportError: Unable to import required dependencies: numpy
Database management tool: dynamic read-write separation
【8.8】代码源 - 【不降子数组游戏】【最长上升子序列计数(Bonus)】【子串(数据加强版)】
数组(一)
2022.8.8 Exam Travel Summary
【图像分类】2022-CycleMLP ICLR
【Image Classification】2022-ResMLP
【语义分割】2022-HRViT CVPR
第二十一章 源代码文件 REST API 参考(三)
2022.8.9考试平衡的余数--1000题解
How Microbes Affect Physical Health
Anchor_generators.py analysis of MMDetection framework
别再用 offset 和 limit 分页了,性能太差!