augmentedstartups / yolov3workflow

This workflow aims to make it easy to train and execute Yolo v3 object detection on Windows.
116 stars 102 forks source link

AssertionError: Cannot capture source #3

Open brightbirdapp opened 6 years ago

brightbirdapp commented 6 years ago

The webcam and external cam connection demo works well, but I'm getting the follwing error when playing a video (python3 video_demo.py --video gws.mp4)

File "video_demo.py", line 119, in assert cap.isOpened(), 'Cannot capture source' AssertionError: Cannot capture source

Thanks for the series on YT --well done!

silversl commented 5 years ago

I have the same problem as you. Can you tell me the solution?

DiegoMartinezGlez commented 5 years ago

This is a classic openCV error on "VideoCapture" when it does not found the source (gws.mp4). check if gws.mp4 is in the same folder as video_demoñ.py. You can also look for VideoCapture line and debug what it is getting as source (print value on console). As alternative, you can write your own path in the VideoCapture line and ignore args parameter:

cap = cv2.VideoCapture("birds.mp4")

Hope this helps. Regards

bvarmamuppala commented 5 years ago

This is a classic openCV error on "VideoCapture" when it does not found the source (gws.mp4). check if gws.mp4 is in the same folder as video_demoñ.py. You can also look for VideoCapture line and debug what it is getting as source (print value on console). As alternative, you can write your own path in the VideoCapture line and ignore args parameter:

cap = cv2.VideoCapture("birds.mp4")

Hope this helps. Regards

Hi, I got the same error when I use the video-file I tried your solution by writing my own path as cap = cv2.VideoCapture("video.mp4") I still got the same error.