Run YOLOv5 on JETSON NANO with CSI-camera

I tried many ways, but still can’t use CSI camera to run YOLOv5 to detect real-time.
Please help me!

This is my code: (15.2 KB)


It seems the camera interface is implemented in the LoadStreams module.
We will need the source as well to check the issue.

from utils.dataloaders import IMG_FORMATS, VID_FORMATS, LoadImages, LoadStreams
    # Dataloader
    if webcam:
        view_img = check_imshow()
        cudnn.benchmark = True  # set True to speed up constant image size inference
        dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt)
        bs = len(dataset)  # batch_size

Are you reading the camera with OpenCV?
If yes, it’s recommended to check the below sample first to see if it helps.

Thanks. (45.6 KB)

Thanks for your answer.
But I don’t know where to put that code.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.

Have you managed to get issue resolved or still need the support? Thanks