sam3-bf16 / README.md
cukrus's picture
sync from github 4b08f9d
68070a8 verified
|
Raw History Blame Contribute Delete
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.