How to change mask and bounding box colour on MaskRCNN output images

I look at the doc on tlt-infer for MaskRCNN and can’t seem to find how to change the mask & bounding boxes colour (the default colour is green), is there a way to change to a different colour?

I will sync with internal team.

1 Like

Thank you @Morganh

Hi @hyperlight
You can try to run the default jupyter notebook. Actually the tlt-infer will mask different objects with different color.

Thanks for the reply @Morganh, I already got annotated images by running tlt-infer but in my problem, I trained maskRCNN to detect one object/class and the object I want to detect has the same colour as the mask (green on green) which make it difficult to inspect how well the model works on unseen images. I want to ask if there is a convenient way in TLT to change the default mask colour to something else? And if there is not a way, does TLT output some sort of output that can be used to annotate the input images? My apology if my initial question was unclear.

Unfortunately, currently there is not an config option for end user to change mask color or bbox color.
Actually the color is controlled by category id and color list.
For you case, if your object is green, and unfortunately the mask is green, yes, it is difficult to identify.

Here is the workaround. Actually there are two ways provided by tlt-infer mask_rcnn.
One is

tlt-infer mask_rcnn

, another is

tlt-infer mask_rcnn --trt

Suggest you trying another way, mostly the mask/bbox color will be not the same. Because the color list for these two inference ways is not the same.

1 Like

Thank you @Morganh , I will look into it.

For anyone who might find this info useful:
tlt-infer mask_rcnn: green box & mask colour
tlt-infer mask_rcnn --trt: red box & mask colour, this also output annotated labels for each image as well