Skip to main content

Segment Anything model for use with Autodistill

Project description

Autodistill Segment Anything Module

This repository contains the code supporting the Segment Anything base model for use with Autodistill.

Segment Anything (SAM) is a segmentation model developed by Meta AI Research. Segment Anything can segment an entire image into masks, or use points to segment specific parts of an object. You can use Segment Anything with Autodistill to segment objects. Segment Anything does not assign classes, so you should use the model with a tool like Grounding DINO or GPT-4V.

Read the full Autodistill documentation.

Read the SAM Autodistill documentation.

Installation

To use SAM with autodistill, you need to install the following dependency:

pip3 install autodistill-segment-anything

Quickstart

from autodistill_segment_anything import SegmentAnything

base_model = SegmentAnything(None)

masks = base_model.predict("./image.jpeg")

print(masks)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autodistill-segment-anything-0.1.1.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page