How to obtain Run length encodings for resized images

I want to use this instance segmentation dataset (Buildings Instance Segmentation Instance Segmentation Dataset and Pre-Trained Model by Roboflow Universe Projects).I want to fine tune sam2.1 using this dataset.But the original dataset contains images of size 640x640.I want images of size 1024x1024.So after resizing the images the new run length encodings need to be obtained.
Please suggest a way to obtain the run length encodings

Hi @Atharva_Deore!
Out of curiosity, how come you are resizing from 640x640 to 1024x1024?

Hey @Ford I want to finetune sam2.1 which is requiring images to be of size 1024x1024 .Image is resized using cv2.resize .Please correct me if anything wrong is done by me.Please help me how to obtain correct Run length encodings

Hi @Atharva_Deore!
Unfortunately you cannot do this within the Roboflow app at this time.

To help, here is a starter prompt you can pass to ChatGPT to assist:

I’m fine-tuning SAM 2.1 using a COCO instance segmentation dataset with 640Ɨ640 images and polygon annotations. I want to resize all images to 1024Ɨ1024 and convert the adjusted annotations to RLE format (since SAM expects binary masks or RLE).
Please give me a Python script that resizes the images to 1024Ɨ1024, scales the polygons accordingly, converts polygons to RLE using pycocotools, saves resized images and a new annotations.json with RLEs compatible with SAM training.

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