SSD detection with camera onboard

Hi,I run ssd_dectect.py with input from on-board camera but I can only get 3-4 fps. If I run ssd_pascal_webcam with usb camera, i can get 8-10 fps. Anyone have experience in this problem?

Hi,

Suppose that you are using this SSD GitHub.

In ssd_dectect.py, SSD read image with python PIL library.
To improve performance, it’s recommended to use GStreamer(python) or Argus(C++) to read a CSI camera.

Thanks.

def open_cam_onboard(width, height):
    # On versions of L4T previous to L4T 28.1, flip-method=2
    # Use Jetson onboard camera
    gst_str = ("nvcamerasrc ! "
               "video/x-raw(memory:NVMM), width=(int)2592, height=(int)1458, format=(string)I420, framerate=(fraction)30/1 ! "
               "nvvidconv ! video/x-raw, width=(int){}, height=(int){}, format=(string)BGRx ! "
               "videoconvert ! appsink").format(width, height)
    return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)

I used it. But performance only get 3 fps

Hi,

Suppose that time should be similar among CSI and USB camera.
Could you also try our jetson_inference sample with both CSI/USB camera?
https://github.com/dusty-nv/jetson-inference#running-the-live-camera-recognition-demo

If the onboard camera case takes longer in inferencing, issue may come from camera driver.
If not, we can check SSD sample or OpenCV in detail.

Thanks.

I tried jetson-inference and got ~10fps with CSI camera.

Hi,

Jetson_inference also use GStreamer for opening the camera.
It’s recommended to compare the difference between jeston_inference and SSD:
https://github.com/dusty-nv/jetson-inference/blob/master/util/camera/gstCamera.cpp#L338

Thanks.

I shared a python script which could do real-time SSD object detection with either JTX2/JTX1 on-board camera, USB webcam or IP CAM. It runs at 5~6 fps for JTX2 on-board camera with pre-trained COCO SSD300 model (would be a little bit faster if VOC0712 SSD300 model is used instead).

Please refer to the following blog post.

https://jkjung-avt.github.io/camera-ssd-threaded/