当前位置:网站首页>Problems when yolov5 calls ip camera

Problems when yolov5 calls ip camera

2022-08-02 03:32:00 woshicaiji12138

I tried to use yolov5-5.0 for real-time target detection today, but when I entered the command:

python detect.py --source http://192.168.xx.xx:xx/video --weights yolov5s.pt

(xx means my own ip)
The following problem always occurs:
[ERROR:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap.cpp (166) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV
exception:

OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can'tfind starting numb
er (in the name of file): http://192.168.3.100:8001/video in function 'cv::icvExtractPattern'

Traceback (most recent call last):
File “detect.py”, line 178, in
detect()
File “detect.py”, line 51, in detect
dataset= LoadStreams(source, img_size=imgsz, stride=stride)
File “D:\yolov5\yolov5-5.0\yolov5-5.0\utils\datasets.py”, line 284, in init
assert cap.isOpened(), f'Failed to open {s}'
AssertionError: Failed to open http://192.168.3.100:8081/video
Insert picture description here
I checked a lot of information on the Internet and couldn't solve it until I saw in a blog that someone else's instruction wassuch

python detect.py --source http://admin:[email protected].x.x.span>x:x

Suddenly I remember that when I click the connection address of the ip camera directly in the terminal of pycharm, this pop-up window will appear:
insert image description here
insert image description here
Only then did I realize how rudimentary my mistake was: I didn't have an ip camera to enter the account number and password.
So re-enter in the terminal:

python detect.py --source http://admin:[email protected]192.168.x.x:x --weights yolov5s.pt

insert image description here
Success!
insert image description here

原网站

版权声明
本文为[woshicaiji12138]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020321109800.html