Unable to access net.GetClassColor(class_id) function

Hello Community,

Note: It is about Python error.

I was trying to access the color values from the class id using the function net.GetClassColor(class_id).
But it gives the following error:
AttributeError: ‘jetson.inference.segNet’ object has no attribute 'GetClassColor

but i was surprised to see that it is already defined in segnet.h as below:
/**
* Retrieve the RGBA visualization color a particular class.
/
inline float
GetClassColor( uint32_t classIndex ) const { return mClassColors[0] + (classIndex*4); }

I am doing something wrong in calling the api? Could you please help.

Thanks and Regards,
Udaykiran Patnaik.

Hi @uday.patnaik, it was missing the binding for segNet.GetClassColor(), sorry about that. I just added it in commit 2fb798, so if you update your repo with the latest and re-run make && sudo make install, it should be there. It returns an (r,g,b,a) tuple.

1 Like

Hello Dusty,

Thank you so much. I will try.

Thanks and Regards,
Udaykiran Patnaik