Yolov5 on jetson nano with csi-camera

Greetings!
Has anyone run yolov5 on a jetson nano with a csi camera?
Share your experience.
How to run csi-camera in python on jetson nano?

Hi,

You can modify the GitHub for CSI camera directly.

Please update the OpenCV command below:
https://github.com/ultralytics/yolov5/blob/master/utils/datasets.py#L195

into

self.cap = cv2.VideoCapture(self._gst_str(), cv2.CAP_GSTREAMER)
...
                
def _gst_str(self):
    return 'nvarguscamerasrc sensor-id=%d ! video/x-raw(memory:NVMM), width=%d, height=%d, format=(string)NV12, framerate=(fraction)%d/1 ! nvvidconv ! video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! videoconvert ! appsink' % (
        self.capture_device, self.capture_width, self.capture_height, self.capture_fps, self.width, self.height)

You can find more information in the jetcam example:
https://github.com/NVIDIA-AI-IOT/jetcam/blob/master/jetcam/csi_camera.py

Thanks.