Detectnet run external python script if person detect

Is there way to make detectnet open python script(turnonlight.py) when person is detect.

detectnet --model=models/person/ssd-mobilenet.onnx --labels=models/person/labels.txt --input-blob=input_0 --output-cvg=scores --output-bbox=boxes rtsp://192.168.2.2/test

Hi,

YES. You can add a system call to launch python script when the numDetections > 0 below:

Thanks.

You might also just want to modify detectnet.py and integrate your turnonlight.py code into it. That way your whole application can be in Python.

That’s great idea but my detectnet.py doesn’t work with rtsp.
with c…<detectnet --input-codec=h264 “rtsp://192.168.100.100/cam/realmonitor?channel=1&subtype=1”> I am able to see the video window…but with <./detectnet.py --input-codec=h264 “rtsp://192.168.100.100/cam/realmonitor?channel=1&subtype=1”> I am not able to see the video window.

Hmm interesting, what error are you getting?

Can you try changing detectnet.py so it creates the videoOutput interface first? Like this:

output = jetson.utils.videoOutput(opt.output_URI, argv=sys.argv+is_headless)
input = jetson.utils.videoSource(opt.input_URI, argv=sys.argv)

If you edit jetson-inference/python/examples/detectNet.py, then re-run these commands so that the updated script is copied to the correct install locations:

# after editing jetson-inference/python/examples/detectNet.py
$ cd jetson-inference/build
$ cmake ../
$ make
$ sudo make install