How can I save the detected image after executing detectnet.py to drive?

Hello! How can I modify detectnet.py to save the detected image to my local drive?

Hi,

detectnet.py by default supports using images as input.

For example:
https://github.com/dusty-nv/jetson-inference/blob/master/docs/detectnet-console-2.md#detecting-objects-from-images

$ ./detectnet.py --network=ssd-mobilenet-v2 images/peds_0.jpg images/test/output.jpg 

You can change the images/peds_0.jpg to the path of your images on the local drive.
Thanks.

1 Like

Hi AastaLL,

Thank you for the response. But what I mean is that I am running my model on a live camera stream, and I want to save an image every time something is detected and save it to my local drive.

I saw from another topic that I can use detectnet-snap.py. I tried running the code, and it worked, but when I view the directory where the images should be stored, no file is saved.

Reference topic: Snap Image when detection (without bounding box) and save into a folder

Hi,

Is there any error message output when saving the image?
Could you also try to use the absolute path in the below link to see if it works?

Thanks.

Hello,

I have already tried running the code without specifying my own directory or using the --snapshots option.

Below is the output when running the code with the default path:

And here is the result when I attempted to locate the default path:

Thank you for your assistance!

Hi

Could you search the file to see where it is stored?

$ sudo find / -iname 20250102-155717-532264-0.jpg

It should be under the build folder or beside the binary location.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.