当前位置:网站首页>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的相机的化,考虑 是否是训练时 就要修改尺寸 ,且 用下面的模型进行训练。
边栏推荐
- liunx PS1 设置
- Pycharm中6个常用插件推荐
- 2022.8.9考试游记总结
- 【Kali安全渗透测试实践教程】第6章 密码攻击
- The Evolutionary History of the "Double Gun" Trojan Horse Virus
- 数据挖掘和数据仓库之间的区别
- [8.8] Code Source - [Non-falling subarray game] [Longest rising subsequence count (Bonus)] [Substring (data enhanced version)]
- Redis - Basic operations and usage scenarios of String|Hash|List|Set|Zset data types
- T5: Text-to-Text Transfer Transformer
- Little rookie Hebei Unicom induction training essay
猜你喜欢
随机推荐
实例047:函数交换变量
T5:Text-toText Transfer Transformer
实例048:数字比大小
推荐几款好用的MySQL开源客户端,建议收藏
Completion of the flag set in 2022
The IDEA to automatically generate the serialVersionUID
6 common plugin recommendations in Pycharm
[Kali Security Penetration Testing Practice Course] Chapter 8 Web Penetration
ArcGIS Advanced (1) - Install ArcGIS Enterprise and create an sde library
Redis - String|Hash|List|Set|Zset数据类型的基本操作和使用场景
ImportError: Unable to import required dependencies: numpy
In automated testing, test data is separated from scripts and parameterized methods
状态压缩小经验
《GB39707-2020》PDF download
小菜鸟河北联通上岗培训随笔
GDB之指令基础参数
liunx PS1 设置
2022.8.9 Exam Travel Summary
OpenCV图像处理学习二,图像掩膜处理
官宣出自己的博客了