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!
Thanks!

This is my code:
detect.py (15.2 KB)

Hi,

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
    else:
        ...

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

Thanks.

dataloaders.py (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.
Thanks

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