FastSAM module for use with Autodistill
Project description
Autodistill FastSAM Module
This repository contains the code supporting the FastSAM base model for use with Autodistill.
FastSAM is a segmentation model trained on 2% of the SA-1B dataset used to train the Segment Anything Model.
Read the full Autodistill documentation.
Read the FastSAM Autodistill documentation.
Installation
To use FastSAM with autodistill, you need to install the following dependency:
pip3 install autodistill-fastsam
Quickstart
[!NOTE]
When you first run this model, the installation process will start. Inference may take a few seconds (in testing, up to 30 seconds) while the model is downloaded and installed. Once the model is installed, inference will be much faster.
from autodistill_fastsam import FastSAM
# define an ontology to map class names to our FastSAM 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 = FastSAM(
ontology=CaptionOntology(
{
"person": "person",
"a forklift": "forklift"
}
)
)
base_model.label("./context_images", extension=".jpeg")
License
This project 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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for autodistill-fastsam-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87aad8b2ae9f6ec785bf43a21c5ec651e3eb483fca30692733f6eb97a85e7c39 |
|
MD5 | 203237de037c541caae25da2fe316797 |
|
BLAKE2b-256 | daa8ef8366ea661d09a938428b74d7a878a62520b5956b827b2191a66c1cbbcc |
Hashes for autodistill_fastsam-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 633c2f28390095baa91c3aeed7f69ad17cb38896c6831f9da9ad96086901fa4c |
|
MD5 | 2896faf2d9de936c94924ef1778f5543 |
|
BLAKE2b-256 | f5616d32300564997ac95de1b30246e80737a20a66e58f688d7baf95cb6b5466 |