https://github.com/autodistill/autodistill-grounded-sam-2
Use Segment Anything 2, grounded with Florence-2, to auto-label data for use in training vision models.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Repository
Use Segment Anything 2, grounded with Florence-2, to auto-label data for use in training vision models.
Basic Info
- Host: GitHub
- Owner: autodistill
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://docs.autodistill.com
- Size: 30.3 KB
Statistics
- Stars: 127
- Watchers: 4
- Forks: 19
- Open Issues: 11
- Releases: 0
Topics
Metadata Files
README.md
Autodistill: Grounded SAM 2 Base Model
This repository contains the code implementing Grounded SAM 2 using Florence-2 as a grounding model and Segment Anything 2 as a segmentation model for use with autodistill.
Florence-2 is a zero-shot multimodal model. You can use Florence-2 for open vocabulary object detection. This project uses the object detection capabilities in Florence-2 to ground the SAM 2 model.
Read the full Autodistill documentation.
Read the Grounded SAM 2 Autodistill documentation.
Installation
To use the GroundedSAM Base Model, simply install it along with a Target Model supporting the detection task:
bash
pip3 install autodistill-grounded-sam-2 autodistill-yolov8
You can find a full list of detection Target Models on the main autodistill repo.
Quickstart
```python from autodistillgroundedsam_2 import GroundedSAM2 from autodistill.detection import CaptionOntology from autodistill.utils import plot import cv2
define an ontology to map class names to our Grounded SAM 2 prompt
the ontology dictionary has the format {caption: class}
where caption is the prompt sent to the base model, and class is the label that will
be saved for that caption in the generated annotations
then, load the model
base_model = GroundedSAM2( ontology=CaptionOntology( { "person": "person", "shipping container": "shipping container", } ) )
run inference on a single image
results = base_model.predict("logistics.jpeg")
plot( image=cv2.imread("logistics.jpeg"), classes=base_model.ontology.classes(), detections=results )
label all images in a folder called context_images
basemodel.label("./contextimages", extension=".jpeg") ```
License
The code in this repository is licensed under an Apache 2.0 license.
🏆 Contributing
We love your input! Please see the core Autodistill contributing guide to get started. Thank you 🙏 to all our contributors!
Owner
- Name: Autodistill
- Login: autodistill
- Kind: organization
- Email: autodistill@roboflow.com
- Website: https://autodistill.com
- Repositories: 1
- Profile: https://github.com/autodistill
Use bigger slower models to train smaller faster ones
GitHub Events
Total
- Issues event: 5
- Watch event: 36
- Issue comment event: 6
- Pull request event: 2
- Fork event: 9
Last Year
- Issues event: 5
- Watch event: 36
- Issue comment event: 6
- Pull request event: 2
- Fork event: 9
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| James | j****g@j****g | 22 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 11
- Total pull requests: 6
- Average time to close issues: about 3 hours
- Average time to close pull requests: N/A
- Total issue authors: 11
- Total pull request authors: 3
- Average comments per issue: 0.36
- Average comments per pull request: 0.5
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 6
- Average time to close issues: 4 minutes
- Average time to close pull requests: N/A
- Issue authors: 4
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.5
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- fikisipi (1)
- walternat1ve (1)
- HasnatHridoy (1)
- mvoodarla (1)
- casabelle42 (1)
- Natty02 (1)
- noorkhokhar99 (1)
- Parfyonator (1)
- nikste (1)
- Bai426 (1)
- Mechazo11 (1)
Pull Request Authors
- lukaboljevic (2)
- AshAnand34 (2)
- lab176344 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 593 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
pypi.org: autodistill-grounded-sam-2
Use Segment Anything 2, grounded with Florence-2, to auto-label data for use in training vision models.
- Homepage: https://github.com/autodistill/autodistill-grounded-sam-2
- Documentation: https://autodistill-grounded-sam-2.readthedocs.io/
- License: MIT License
-
Latest release: 0.1.0
published almost 2 years ago
Rankings
Maintainers (1)
Dependencies
- autodistill *
- autodistill_florence_2 *
- numpy >=1.20.0
- opencv-python >=4.6.0
- roboflow *
- supervision *
- torch *