Running yolov3 demo using jetson nano and rpi camera

i use nvidia jetson nano with rpi camera to run yolov3, i’m 100% sure that the camera is compatible and working perfectly.
when i try to run live detection demo using this command

./darknet detector demo data/yolo.data cfg/yolov3_custom_train.cfg yolov3_custom_train_3000.weights -c 0
i get

CUDA-version: 10000 (10000), cuDNN: 7.6.3, GPU count: 1
OpenCV version: 4.3.0
Demo
net.optimized_memory = 0

i get the following warnings

[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (1759) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

then the demo window pops up and i get a constant green screen

is there any recommended solution?

Hi,

Raspberry pi camera is a CSI camera.
Please use nvarguscamerasrc rather than v4l2src to enable a CSI camera.

./darknet detector demo data/yolo.data cfg/yolov3_custom_train.cfg yolov3_custom_train_3000.weights " nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! Appsink"

Thanks.

i used this command and i got the following

video file: nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! Appsink
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (713) open OpenCV | GStreamer warning: Error opening bin: no element “Appsink”
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ERROR:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap.cpp (142) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.3.0-pre) /home/jn/opencv_build/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can’t find starting number (in the name of file): nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! Appsink in function ‘icvExtractPattern’

and this message is printed continuously

Video-stream stopped!
Video-stream stopped!
Video-stream stopped!
Video-stream stopped!
Video-stream stopped!

Hi,

It looks like you are meeting the same error of topic 112954:

However, the user fixes it by using the NV12 as nvarguscamerasrc output format, which is what I share with you.
To narrow down the issue, could you run this command to see if the camera works without OpenCV first?

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv flip-method=3 ! 'video/x-raw(memory:NVMM), width=(int)480, height=(int)640, format=(string)I420' ! nvoverlaysink -e

Thanks.

I have the same problem. Display “Video-stream stopped!”

I tried using this command
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv flip-method=3 ! 'video/x-raw(memory:NVMM), width=(int)480, height=(int)640, format=(string)I420' ! nvoverlaysink -e

But everything’s fine, the cameras are working

I just tried to run command
"./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights ‘nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink’
It can work