当前位置:网站首页>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的相机的化,考虑 是否是训练时 就要修改尺寸 ,且 用下面的模型进行训练。

边栏推荐
- T5:Text-toText Transfer Transformer
- [Semantic Segmentation] 2022-HRViT CVPR
- ImportError: Unable to import required dependencies: numpy
- 2022强网杯 Quals Reverse 部分writeup
- 手把手教你搭建ELK-新手必看-第一章:什么是ELK?
- 【Kali安全渗透测试实践教程】第8章 Web渗透
- Anchor_generators.py analysis of MMDetection framework
- T5: Text-to-Text Transfer Transformer
- LeetCode每日两题02:两数之和 II - 输入有序数组 (均1200道)
- 2020.11.22 Exam Goldbach Conjecture Solution
猜你喜欢

微生物是如何影响身体健康的

【Image Classification】2022-ResMLP

Database management tool: dynamic read-write separation

OpenCV图像处理学习三,Mat对象构造函数与常用方法

MySQL:日志系统介绍 | 错误日志 | 查询日志 | 二进制日志:bin-log数据恢复实践 | 慢日志查询

【二叉树-中等】508. 出现次数最多的子树元素和

【图像分类】2022-ConvMixer ICLR

Difference Between Data Mining and Data Warehousing

【二叉树-中等】687. 最长同值路径

OpenCV图像处理学习一,加载显示修改保存图像相关函数
随机推荐
FusionConpute虚拟机的发放与管理
FusionCompute产品介绍
《GB39707-2020》PDF下载
what is eabi
excel高级绘图技巧100讲(二十三)-Excel中实现倒计时计数
[Kali Security Penetration Testing Practice Course] Chapter 7 Privilege Escalation
What makes training multi-modal classification networks hard?
数据治理(五):元数据管理
手把手教你搭建ELK-新手必看-第一章:什么是ELK?
算法与语音对话方向面试题库
官宣出自己的博客啦
2022.8.9 Exam arrangement and transformation--1200 questions solution
Write a drop-down refresh component
[Semantic Segmentation] 2022-HRViT CVPR
2022.8.8考试区域链接(district)题解
实例043:作用域、类的方法与变量
宝塔服务器PHP+mysql网页URL跳转问题
[Kali Security Penetration Testing Practice Tutorial] Chapter 6 Password Attack
MySQL: What MySQL optimizations have you done?
【图像分类】2022-CycleMLP ICLR