Instructions to use SMLBuilder/MLX_SAM3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SMLBuilder/MLX_SAM3 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download SMLBuilder/MLX_SAM3 --local-dir MLX_SAM3
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
|
Download README.md from SMLBuilder/MLX_SAM3: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/SMLBuilder/MLX_SAM3/resolve/main/README.md
- Command line
-
hf download hf://SMLBuilder/MLX_SAM3/README.md
-
curl -L -o README.md https://huggingface.co/SMLBuilder/MLX_SAM3/resolve/main/README.md
1.32 kB
metadata
license: apache-2.0
base_model:
- facebook/sam3
tags:
- mlx
SAM3 MLX Examples
Example scripts demonstrating how to use SAM3 MLX for segmentation tasks.
Click-Based Segmentation
Segment objects by clicking on them with positive/negative points.
Basic Usage
# Segment with a single positive click
python click_segment.py --image photo.jpg --point 512,384
# Segment with multiple points
python click_segment.py --image photo.jpg --point 512,384 --point 600,400
# Use positive (+) and negative (-) points for refinement
python click_segment.py --image photo.jpg --point +512,384 --point -100,100
# Save visualization
python click_segment.py --image photo.jpg --point 512,384 --output result.png
# Get single best mask instead of 3 masks
python click_segment.py --image photo.jpg --point 512,384 --single-mask
Requirements
pip install pillow matplotlib mlx
Performance
On Apple Silicon with MLX:
- Model initialization: ~2-3s
- Single inference: <200ms (target performance)
- Multiple masks: 3 predictions per inference
Box-Based Segmentation
Coming soon: Segment using bounding box prompts.
Mask-Based Refinement
Coming soon: Refine existing masks with additional mask prompts.
Batch Processing
Coming soon: Process multiple images efficiently.