Skip to main content

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!

Release files for autodistill-fastsam 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autodistill-fastsam 0.1.1
File Size Uploaded
autodistill-fastsam-0.1.1.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autodistill-fastsam 0.1.1
File Interpreter ABI Platform
autodistill_fastsam-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / autodistill-fastsam-0.1.1.tar.gz

Download URL autodistill-fastsam-0.1.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87aad8b2ae9f6ec785bf43a21c5ec651e3eb483fca30692733f6eb97a85e7c39
BLAKE2b-256 checksum
How to use checksums
daa8ef8366ea661d09a938428b74d7a878a62520b5956b827b2191a66c1cbbcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / autodistill_fastsam-0.1.1-py3-none-any.whl

Download URL autodistill_fastsam-0.1.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
633c2f28390095baa91c3aeed7f69ad17cb38896c6831f9da9ad96086901fa4c
BLAKE2b-256 checksum
How to use checksums
f5616d32300564997ac95de1b30246e80737a20a66e58f688d7baf95cb6b5466
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page