Downloads · 30 days
0
mlx-community/sam3-image
sam3-image is a image segmentation model from mlx-community. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as other.
Segment Anything Model 3 — Native Apple Silicon Implementation
Downloads · 30 days
0
Access
Public
Updated Dec 24, 2025
Parameters
849M
6.8 GB on disk
Likes
21
Public
Click a slice to open those files.
.safetensors3.4 GB · 100%
How the weights are stored.
F32848M · 100%
From the Hugging Face model README
Segment Anything Model 3 — Native Apple Silicon Implementation
<p align="center"> <a href="https://github.com/ml-explore/mlx"><img src="https://img.shields.io/badge/MLX-Framework-blue" alt="MLX"></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.13+-green" alt="Python 3.13+"></a> <a href="https://github.com/Deekshith-Dade/mlx_sam3"><img src="https://img.shields.io/badge/GitHub-Repository-black" alt="GitHub"></a> </p>This is an MLX port of Meta's SAM3 model, optimized for native execution on Apple Silicon (M1/M2/M3/M4) Macs.
📖 Learn more: Check out the accompanying blog post explaining the SAM3 architecture and this implementation.
SAM3 (Segment Anything Model 3) is a powerful image segmentation model that can segment objects in images using:
This MLX port provides native Apple Silicon performance, leveraging Apple's MLX framework for optimized inference on Mac.
# Clone the repository
git clone https://github.com/Deekshith-Dade/mlx_sam3.git
cd mlx-sam3
# Install with uv (recommended)
uv sync
# Or with pip
pip install -e .
from PIL import Image
from sam3 import build_sam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor
# Load model (auto-downloads weights on first run)
model = build_sam3_image_model()
processor = Sam3Processor(model, confidence_threshold=0.5)
# Load and process an image
image = Image.open("your_image.jpg")
state = processor.set_image(image)
# Segment with text prompt
state = processor.set_text_prompt("person", state)
# Access results
masks = state["masks"] # Binary segmentation masks
boxes = state["boxes"] # Bounding boxes [x0, y0, x1, y1]
scores = state["scores"] # Confidence scores
print(f"Found {len(scores)} objects")
Launch the interactive web application:
cd app && ./run.sh
| Requirement | Version | Notes |
|---|---|---|
| macOS | 13.0+ | Apple Silicon required (M1/M2/M3/M4) |
| Python | 3.13+ | Required for MLX compatibility |
| Node.js | 18+ | For the web interface (optional) |
⚠️ Apple Silicon Only: This implementation uses MLX, which is optimized exclusively for Apple Silicon.
If you use this model, please cite the original SAM3 paper and this MLX implementation:
@misc{mlx-sam3,
author = {Deekshith Dade},
title = {MLX SAM3: Native Apple Silicon Implementation},
year = {2024},
url = {https://github.com/Deekshith-Dade/mlx_sam3}
}
Built with ❤️ for Apple Silicon