pytorch_YOLO_OpenVINO_demo
pytorch_YOLO_OpenVINO_demo copied to clipboard
cv2.VedioCapture("bus.jpg") will report an error
My model was exported successfully. When my input was a video, the program performed fine, but when my input was an image, the program responded with an error.
How can I fix this demo to solve this problem?
Try to type "D:\bus.jpg" instead of "D:/bus.jpg".
Same mistake. @Chen-MingChang
@zengqingfa Please check your path where "bus.jpg" is. In my sample, it is images/bus.jpg
videocapture is used to read image sequence or video: https://docs.opencv.org/3.4/d8/dfe/classcv_1_1VideoCapture.html#a949d90b766ba42a6a93fe23a67785951 So, you'd better rename your image to bus001.jpg or use video file instead.
@zengqingfa After checking, this problem is related to media files with audio streams and MSMF backend. You can follow the link bellow to expand your opencv support.
https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/OpenCV-4-1-2-openvino-CAP-IMAGES-can-t-find-starting-number-in/m-p/1129123#M8204
This seems to be a problem with the OpenCV
version used by OpenVino2021.1
, I have read elsewhere that OpenVino2021.2
has fixed this problem, that OpenVino2021.2
can read videos and images using cv2.VedioCapture (path)
, the previous version doesn't seem to work.
Since I only need to read the image, I use cv2.imread (img_path)
instead of cv2.vediocapture (path)
, but other things have changed as well. Now the program can be used normally.So I have no problem with this program. Thanks for the answer.