Method for Making DetectNet Run Faster?

Hi all,

I was wondering if there is a way to make the DetectNet display run faster? I am running a program that sends information from DetectNet to an arduino and I am pretty sure I have debugged everything and the code works. Every time I launch the python script, the detectNet display either opens and runs at 1 fps before freezing, or it tries to open and I get this:

Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:656 Failed to create CaptureSession
[gstreamer] gstCamera – end of stream (EOS)

(python3:10576): GStreamer-CRITICAL **: 10:35:38.245: gst_mini_object_set_qdata: assertion ‘object != NULL’ failed

Here is the code below for reference. Also, I know I have more than enough memory while the program is running so I know that isnt the issue.

Hi @jpurpura37, does run ok on your system before the modifications?

It appears you are creating a new Serial interface on every iteration of the main loop. You also create a Serial interface up above, at initialization time (which should be the correct time to do it). You probably should only create the arudino = serial.Serial(...) interface once at the beginning.

Also, add some timing around the arduino.write() call to see if it is blocking the execution for extended periods of time. If it is, you should run that from a separate Python thread.

I think re-initializing the port was the issue, not sure why I was doing that so thanks for pointing that out. Also, it looks like in order to add timing functions I have to import a time module. Where would be a good place to get that?

Near the top where the other modules are imported - in Python, it’s a best practice to import the modules at the beginning of the script (although not strictly required)

Sorry, I meant where can I download the time library, or is it already somewhere in the jetson-inference repo?

The time library is a built-in module that comes with Python:

Should just be able to import time without installing anything extra.

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