mhyeonsoo / SAM_gDINO_AutoLabeling

Auto Segmentation label generation with SAM (Segment Anything) + Grounding DINO
Apache License 2.0
15 stars 7 forks source link

SAM_gDINO_AutoLabeling

Auto Segmentation label generation with SAM (Segment Anything) + Grounding DINO

How To Use

1. Requirements

2. How to Run the Label generation scripts.

1. Download the pretrained weights

# download the pretrained groundingdino-swin-tiny model
wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
# move downloaded model to ./weights directory

2. Run the jupyter notebook

Auto-Label-Generation is a notebook for generating labels

- Format of generated annotation

1. Yolov8
2. COCO

3. Custom configs / arguments

To get the labels for your custom image inputs, we need to modify these in the Auto-Label-Generation notebook.

1. text prompt input for grounding DINO
TEXT_PROMPT = "[classes of custom dataset]" 
# (for multi-class, you can add . between each class --> 'class1 . class2 . class3')
2. category list for COCO annotation
CAT_ID = {'class1': 1, 'class2': 2, 'class3': 3, 'class4': 4, 'class5': 5, 'class6': 6}
# COCO category list is in form of a python dictionary

Aknowledgements