How to get the amount of pixels belonging to Mask RCNN mask
• Hardware Platform (Jetson / GPU) Jetson nano
• DeepStream Version 6.0
• JetPack Version (valid for Jetson only) 4.6
• TensorRT Version 8.0.1
I want to count the numer of pixels belonging to each segmented instance using Mask RCNN.
To do so, first I wanted to acces to the mask data in the same way I can acces to the detection data when I use a detection model.
From the documentation: NVIDIA DeepStream SDK API Reference: nvll_osd_struct.h Source File
I see that can acces to its values with the following lines:
NvOSD_MaskParams *mask = (NvOSD_MaskParams*) &(obj_meta->mask_params);
g_print("Aure: mask: size: %u, threshold: %f, width: %u, height: %u\n",mask->size,mask->threshold,mask->width,mask->height);
However, I allways see the same following log FOR EVERY INSTACE in EVERY FRAME:
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Frame Number = 38 Vehicle Count = 3 Person Count = 0
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Frame Number = 39 Vehicle Count = 4 Person Count = 0
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
Aure: mask: size: 3136, threshold: 0.000000, width: 28, height: 28
which make no sense.
Note: I can perfectly visualize the masks and its corresponding bboxes and class, so the model is doing fine.
What I am doing wrong ? How should I acces to the mask data?
Thanks you in Advance!