When I use the DetectNet to dectect the object, how can I use python to write detect in resion of interest ?
I modified jetson-inference/python/examples/detectnet.py but there is no response.
Where is the code to read and output the frame?
After you modified detectnet.py, did you run it from jetson-inference/python/examples/ ? Otherwise you would want to run cmake ../ && make && sudo make install from your build dir so that your updates get installed to the system. What I actually recommend is making your own copy of detectnet.py and calling it something else to avoid confusion, since copies of detectnet.py get installed to jetson-inference/build/aarch64/bin and also /usr/local/bin, and it might be that you are actually running the previous version from before your edits.
If you run cmake ../ from your jetson-inference/build directory, it will copy all the .py files under jetson-inference/python/examples to jetson-inference/build/aarch64/bin. And then when you run sudo make install it will install them under /usr/local/bin
You can save your own version of detectnet.py to any directory that you want to though.
Hmm, can you try changing the ordering in which you import the modules to see if that has an effect? i.e. import cv2 after you import jetson_inference/jetson_utils (or vice versa)
Or if that doesn’t work, try import cv2 after you create the detectNet object.