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] huggingface-cli download --local-dir MLX_SAM3 SMLBuilder/MLX_SAM3
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
| 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 | |
| ```bash | |
| # 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 | |
| ```bash | |
| 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. |