Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BBOX to SEG with SAM

This repo uses the Segment Anything Model (SAM) to automatically convert your bounding box dataset into a segmentation polygon dataset.

image

This tool will take the bbox camp of your COCO label and use that to populate the segmentation camp automatically.

How to Use

Tested with python 3.10 and higher.

First, clone this repository and install python requirements:

git clone https://github.com/kikefdezl/bbox-to-seg.git 
pip install -r requirements.txt

Then, run:

python3 main.py COCO_JSON IMAGES OUTPUT

where:

  • COCO_JSON: Path to your COCO JSON file.
  • IMAGES: Path to the folder with the images.
  • OUTPUT: Path where you want to save the output to. This can be a folder or a full path including the filename and .json extension.

Example:

python3 main.py /path/to/my/coco.json /path/to/my/images/ /path/to/my/output.json

The program will populate the segmentation camp of you annotations in the COCO label. This camp will be overwritten if it already exists.

About

Convert your COCO dataset from bboxes to segmentation masks

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages