Cannot set threshold for segnet

Hi, i’m using segNet(jetson.inference.segNet) to infer retrained deeplabv3_resnet50 network. Using python, im not sure how to set threshold for output mask. Only can see alpha blending overlay value, also not sure what this value is for. And also if someone able to provide me raw code to infer basically any model not only segmentation or detection will appreciate as well.


You can find the class process below:
To add a threshold, please limit the p value to above a certain score and then update the p_max and c_max values.


Thank you!

Okey, but as i’m using python for my development purposes especially importing jetson.inference/jetson.utils and after accessing jetson.inference.segNet() could you please suggest how can I configure that threshold from python or in other case how can i rebuild everything( probably with edited cpp file) thank you in advance.

Hi @andriizelenko11, you can rebuild everything by running the following steps:

cd jetson-inference/build
cmake ../
make -j$(nproc)
sudo make install

First you would want to add an API for setting a threshold variable to the segNet C++ class. Then you would want to add a Python binding for that new function in python/bindings/segNet.cpp

In case someone like me(not quite strong in cpp-python api adding) threshold could be added whenever mask is extracted according to the pixel value intensity

		mask = self.buffers.mask
		maskNumpy = jetson.utils.cudaToNumpy(mask)
		maskNumpy = maskNumpy//thresholdValueInPixels * 255 # replace your threshold value - its not a percantage value and shell be estimated by trials 

Thank you anyway!)

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