Instructions to use cukrus/sam3-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cukrus/sam3-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("mask-generation", model="cukrus/sam3-bf16")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("cukrus/sam3-bf16") model = AutoModel.from_pretrained("cukrus/sam3-bf16", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from cukrus/sam3-bf16: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/cukrus/sam3-bf16/resolve/main/README.md
- Command line
-
hf download hf://cukrus/sam3-bf16/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/cukrus/sam3-bf16/resolve/main/README.md
1.26 kB
metadata
license: other
license_name: sam-license
license_link: LICENSE
base_model: facebook/sam3
base_model_relation: quantized
library_name: transformers
pipeline_tag: mask-generation
tags:
- sam3
- segmentation
- bf16
extra_gated_prompt: >-
bf16 copy of Meta's SAM 3, distributed under the SAM License (see LICENSE). By
requesting access you agree to its terms.
SAM 3 bf16
facebook/sam3 cast from fp32 to bf16.
| size | |
|---|---|
| fp32 (original) | 3.44 GB |
| bf16 | 1.72 GB |
Floating-point tensors cast to bf16, everything else unchanged (configs, tokenizer, integer
tensors). Conversion script: sam3-convert.py.
Mask IoU vs fp32: ≥ 0.999 on the tested images.
Examples
bf16 masks, text prompts car, fox, person.
import torch
from transformers import Sam3Model, Sam3Processor
model = Sam3Model.from_pretrained("cukrus/sam3-bf16", torch_dtype=torch.bfloat16).to("cuda")
processor = Sam3Processor.from_pretrained("cukrus/sam3-bf16")
Jetson Orin Nano 8GB: load 3 s, inference ~2 s, +0.2 s per extra text phrase.
License
SAM License, see LICENSE.


