I am currently trying to run YOLO on my Jetson Nano and apparently it is unable to switch on the webcam. However, the predictions all came out on the terminal but the webcam viewer is not appearing even though the light on the camera is switched on. The webcam I am using is C270 Logitech Webcam.
Another problem is that my other Jetson Nano is facing similar issues. However, in this case, the webcam does not switched on at all and no predictions on the terminal but an error message that says videostream stops which runs continuously without stopping.
Is there anyone who faced the same issue and is able to help me solve this problem? Hope there is a reply soon as I need it for my project now.
This error means the image file is empty, that is, wrong file name or wrong path.
Make sure that your image file is existing where you want and replace āyour-image.jpgā of imread.
Even JetPack already has pre-built OpenCV, if you want to re-install OpenCV, sudo apt install python3-opencv
Ya I tried it with the small Python Code that you sent. It was an error because I didnāt change the image filename. So with that code you gave me, it works.
Did you compile the Darknet correctly?
In Makefile
# Set these variable to 1:
GPU=1
CUDNN=1
OPENCV=1
# Uncomment the following line
# For Jetson TX1, Tegra X1, DRIVE CX, DRIVE PX - uncomment:
ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]
# Replace NVCC path
NVCC=/usr/local/cuda/bin/nvcc
Maybe you can try different input methods for Darknet.
This would work if /dev/video0 is a UVC camera such as most USB webcams.
However, if you are using a RPi v2 camera, it is not, it is a bayer sensor providing RG10 format.
The command provided by @Edwin2087 will use a gstreamer pipeline reading from CSI and debayering with nvarguscamerasrc plugin, converting into BGRx format while resizing with hardware, then converting into BGR with videoconvert as expected by the app.