How to encode custom data into PaliGemma segmentation tokens ? #135
-
Hello, I have a labeled segmentation dataset I want to encode into segmentation tokens to fine-tune PaliGemma. My segmentation masks are in polygons which I convert into a binary mask and into a bounding box to encode with the refcoco_mask2str() function. I'm working with the code below and no matter the mask I get the same segmentation tokens as output:
If I decode this mask again, I get a close to zero IoU score with the original mask. Is this the right approach to encode custom data, or am I missing something ? Thanks for any help in advance! :) Code below:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I am also facing the same issue. Are you able to resolve this problem? @VitoVoelker |
Beta Was this translation helpful? Give feedback.
In your case, I guess, it is the mask, please make sure that mask[mask > 0] = 255, because,inside get_refcoco_mask2str function it will be divided by 255 and normalized in the range -1 to +1