当前位置:   article > 正文

yolov5摄像头问题汇总_为什么yolo调用的摄像机特别卡

为什么yolo调用的摄像机特别卡

view-img参数的作用

在这里插入图片描述
如图加入三行print

if webcam:
    print("test place 1")
    print(view_img)
    view_img = check_imshow()
    print(view_img)
    cudnn.benchmark = True  # set True to speed up constant image size inference
    dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt)
    bs = len(dataset)  # batch_size
else:
    dataset = LoadImages(source, img_size=imgsz, stride=stride, auto=pt)
    bs = 1  # batch_size
vid_path, vid_writer = [None] * bs, [None] * bs
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

输入

python detect.py --source 1 --weights yolov5s.pt --device 0
  • 1

在这里插入图片描述
输入:

python detect.py --source 1 --weights yolov5s.pt --device 0 --view-img
  • 1

在这里插入图片描述
可见只要webcam is True,进入这个if后不管view-img之前是不是True,都会被check_imshow()改为True。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/373517
推荐阅读
相关标签
  

闽ICP备14008679号