Segment Anything 3 (SAM 3) β€” ONNX Models

ONNX export of Meta's SAM 3 β€” the open-vocabulary, text-promptable segmentation model β€” packaged for use with onnxruntime and AnyLabeling.

Why this repo exists

SAM 3 brings open-vocabulary text prompts to the SAM family: instead of clicking points or drawing boxes, you can describe the object in natural language and the model segments it. ONNX gives you a portable, dependency-light runtime that works in Python, C++, JavaScript, and most embedded targets. This is the export that AnyLabeling consumes for its smart-labeling features.

Variants

File Backbone Size
sam3_vit_h.zip ViT-H 3.2 GB

The zip bundles the encoder + decoder + text-prompt encoder ONNX files for the ViT-H backbone.

Quick start

pip install huggingface_hub onnxruntime
from huggingface_hub import hf_hub_download
import zipfile, onnxruntime as ort

zip_path = hf_hub_download(repo_id="vietanhdev/segment-anything-3-onnx-models",
                           filename="sam3_vit_h.zip")
with zipfile.ZipFile(zip_path) as z:
    z.extractall("./sam3")

# Inspect the unzipped files and load the components you need:
import os
for f in sorted(os.listdir("./sam3")):
    print(f)

For the full text β†’ mask pipeline, see how AnyLabeling wires it: https://github.com/vietanhdev/anylabeling

Use with AnyLabeling

These models drop into AnyLabeling's auto-labeling backend without conversion. See the AnyLabeling docs for the model-config wiring.

Source weights

Original SAM 3 weights and license: https://huggingface.co/facebook/sam3

This repo redistributes the same weights in ONNX format. License unchanged from upstream (Apache 2.0).

Citation

@misc{nguyen2026sam3_onnx,
  author = {Nguyen, Viet-Anh and {Neural Research Lab}},
  title  = {SAM 3 ONNX Models},
  year   = {2026},
  url    = {https://huggingface.co/vietanhdev/segment-anything-3-onnx-models}
}

For the underlying model, cite Meta's SAM 3 release (see https://huggingface.co/facebook/sam3 for the canonical citation).

Acknowledgments

Thanks to Meta AI Research for releasing SAM 3 with open weights. This repo packages their work for edge inference.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for vietanhdev/segment-anything-3-onnx-models

Base model

facebook/sam3
Finetuned
(11)
this model