I am using https://github.com/theAIGuysCode/yolov4-custom-functions this repository. I want to crop and save pictures while running on webcam. I'm using Colab. But when I run the following code:
!python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video 0 --output ./detections/results2.avi --crop
then it says:
[ WARN:0@5.489] global /io/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Video has ended or failed, try a different video format!
I know the problem is with opening the camera in Colab. But I couldn't find how to solve it.