Skip to main content

sam3-mlx

Segment images from text and geometric prompts with an unofficial native MLX port of SAM 3.

Docs · MedMLX

Text prompts “person” and “helmet” → masks on a real photograph.

Text prompts “person” and “helmet” → masks on a real photograph.

Input Output
Image + text, boxes or points Masks, boxes and confidence scores

Apple Silicon · Metal · Python 3.13+ · uv

Quick start

uv venv --python 3.13
source .venv/bin/activate

uv pip install sam3-mlx

By default, preconverted image weights download from a pinned mlx-community/sam3-image revision on Hugging Face. Converting the official PyTorch checkpoint separately requires access to that checkpoint.

from sam3_mlx import build_sam3_image_model
from sam3_mlx.model.sam3_image_processor import Sam3Processor

model = build_sam3_image_model()
processor = Sam3Processor(model, resolution=1008)

state = processor.set_image("image.jpg")
state = processor.set_text_prompt("shoe", state)

masks, boxes, scores = state["masks"], state["boxes"], state["scores"]

Use a resolution divisible by 14. Selected-frame video runs each frame independently; temporal tracking and SAM 3.1 are experimental.

License

SAM License; see LICENSE and third-party notices. Unofficial port; not affiliated with Meta. Official checkpoints have separate access terms.

For research and education. Outputs require human review.

Metadata

Release files for sam3-mlx 0.1.5.post1

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

Source distribution (sdist)

Source distribution for sam3-mlx 0.1.5.post1
File Size Uploaded Provenance Actions
sam3_mlx-0.1.5.post1.tar.gz 1.9 MB Without provenance Details for sam3_mlx-0.1.5.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sam3-mlx 0.1.5.post1
File Interpreter ABI Platform Actions
sam3_mlx-0.1.5.post1-py3-none-any.whl Python 3 none any Details for sam3_mlx-0.1.5.post1-py3-none-any.whl

Total release size: 3.8 MB

Release files / sam3_mlx-0.1.5.post1.tar.gz

Download URL sam3_mlx-0.1.5.post1.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
5ee0f5754605b747bad684816f3dab50bfa992eed162a22397ce4d95faed5e09
BLAKE2b-256 checksum
How to use checksums
513befe34a1ee992f40b924a37c41651db6e1176377e212e7d5b2e781f087174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sam3_mlx-0.1.5.post1-py3-none-any.whl

Download URL sam3_mlx-0.1.5.post1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
62aed0742ab14ead3efa44fe75347fcb0f86746890d94a64a763e95f55d92135
BLAKE2b-256 checksum
How to use checksums
b2d2192a8a1d1e21c2ed4a2f71776f2e17df6a47d2b2c4d897eac2e267bc7972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sam3-mlx 0.1.5.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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