Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Autodistill integration to README #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

capjamesg
Copy link
Contributor

The Roboflow team created an extension to Autodistill that lets someone use FastSAM to automatically label data for use in training a computer vision model. Autodistill enables people to label datasets using foundation models and train models like FastSAM using state-of-the-art architectures like YOLOv8 and DETR

This PR adds a link to the Autodistill FastSAM project so people can use FastSAM to label data in a few lines of code.

I am excited to see people use FastSAM to train fine-tuned models!

@zxDeepDiver
Copy link
Collaborator

Hi there! We think robotflow is an amazing project, and we're thrilled to contribute to it. However, we're facing some difficulty in finding sufficient tutorials for using fastsam in robotflow. Could you assist us in obtaining this information?

@capjamesg
Copy link
Contributor Author

Thank you for your response! We enable people to use FastSAM to auto-label data in the Autodistill framework. Here is an example:

from autodistill_fastsam import FastSAM
from autodistill.detection import CaptionOntology

# 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"
        }
    )
)

results = base_model.predict("image.png")

# get bounding box coordinates
print(results)

base_model.label("./context_images", extension=".jpeg")

Above, you would replace "person" and "a forklift" with the objects you want to identify (that FastSAM can identify!), and ./context_images with the name of a folder of images that you want to label. We don't track usage per model, but we do know that Autodistill as a whole has been used to label 10,000s of thousands of images; the more models we support, the more choice people have when they are auto-labeling images.

We don't have a full FastSAM labeling guide, but there will be more docs on this integration in our documentation update coming next week.

On a separate note, I wrote a quick what is guide: https://blog.roboflow.com/what-is-fastsam/

@capjamesg
Copy link
Contributor Author

Following up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants