Skip to main content

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!

Release files for autodistill-segment-anything 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-segment-anything 0.1.1
File Size Uploaded
autodistill-segment-anything-0.1.1.tar.gz 9.4 kB Details

Built distribution (wheel)

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

Total release size: 17.3 kB

Release files / autodistill-segment-anything-0.1.1.tar.gz

Download URL autodistill-segment-anything-0.1.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7b29e006386cc2354f3eafe6394fd226562277f68c4f948533e6596586a2120c
BLAKE2b-256 checksum
How to use checksums
bba505d8ee7ea036b52e34ea5d7df66af35f1b21eb065d85577504e4fb8fde49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

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

Download URL autodistill_segment_anything-0.1.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c5f63f74b77f3e333644ad1b8f4b13ae2615bc32df75978e7f45cdcad0cd735
BLAKE2b-256 checksum
How to use checksums
555a7fa375fb28c55aa58a23f8eee2cca0073f962948a12ef96697778bafc3c2
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