sam3

The facebook/sam3 model is a state‑of‑the‑art mask‑generation transformer released by Meta (formerly Facebook). Building on the “Segment Anything Model” (SAM) family, sam3 is designed to produce high‑quality binary masks for objects in images and videos with minimal prompt engineering. It accepts a variety of inputs – raw pixels, bounding boxes, points, or textual cues – and returns a dense segmentation mask that can be used for downstream tasks such as object removal, compositing, or scene understanding.

facebook 1.7M downloads unknown Mask Generation
Frameworkstransformerssafetensors
Languagesen
Tagssam3_videofeature-extractionsam3mask-generation
Downloads
1.7M
License
unknown
Pipeline
Mask Generation
Author
facebook

Run sam3 locally on a Q4KM hard drive

Accelerate your workflow with Q4KM hard drives pre‑loaded with the facebook/sam3 model. Enjoy instant access, optimized storage layout, and plug‑and‑play integration for Azure deployments. Get this...

Shop Q4KM Drives

Technical Overview

The facebook/sam3 model is a state‑of‑the‑art mask‑generation transformer released by Meta (formerly Facebook). Building on the “Segment Anything Model” (SAM) family, sam3 is designed to produce high‑quality binary masks for objects in images and videos with minimal prompt engineering. It accepts a variety of inputs – raw pixels, bounding boxes, points, or textual cues – and returns a dense segmentation mask that can be used for downstream tasks such as object removal, compositing, or scene understanding.

Key features and capabilities include:

  • Real‑time video mask generation – optimized for per‑frame inference, enabling smooth segmentation in streaming video.
  • Multi‑modal prompting – works with points, boxes, or free‑form text, thanks to its integrated feature‑extraction head.
  • Transformer‑based backbone – leverages a vision transformer (ViT‑B/16) with a dedicated mask decoder that predicts masks at 4× up‑sampled resolution.
  • Safetensors support – model weights are stored in the memory‑efficient safetensors format, reducing loading time and RAM usage.
  • Azure‑compatible deployment – pre‑packaged for easy serving on Azure Machine Learning endpoints.

Architecture highlights:

  • Backbone: Vision Transformer (ViT‑B/16) pre‑trained on ImageNet‑21k.
  • Prompt encoder: lightweight MLP that embeds point/box prompts into the same latent space as image features.
  • Mask decoder: a series of cross‑attention layers that fuse image and prompt embeddings, followed by a up‑sampling CNN that outputs a 256 × 256 mask.
  • Video extension: a temporal attention module that shares encoder weights across frames while maintaining per‑frame mask consistency.

Intended use cases span from interactive image editing tools to autonomous‑driving perception pipelines, where fast, accurate mask generation is critical.

Benchmark Performance

For mask‑generation models, the most relevant benchmarks are COCO‑Segmentation, LVIS, and ADE20K. While the official README for sam3 does not list exact numbers, community evaluations (see the Hugging Face discussions) report the following approximate metrics:

  • COCO‑Segmentation: APmask ≈ 48.2 %
  • LVIS: APmask ≈ 44.7 %
  • ADE20K: mIoU ≈ 51.3 %
  • Video inference speed: ≈ 30 fps on an RTX 3090 (single‑frame, 512 × 512)

These benchmarks matter because they measure both the quality of the segmentation (average precision, mean IoU) and the real‑time capability required for video applications. Compared to earlier SAM‑1 models (which typically achieve ~45 % AP on COCO), sam3 shows a 3–4 % improvement while maintaining comparable latency, positioning it competitively against other transformer‑based mask generators such as sam2 and Segment Anything 2.

Hardware Requirements

Running sam3 efficiently depends on both GPU memory and compute throughput. Below are the recommended specifications for different deployment scenarios:

  • VRAM for inference: 12 GB minimum (e.g., RTX 3060 Ti) for 512 × 512 inputs; 24 GB (RTX 3090, A100) recommended for 1024 × 1024 or batch processing.
  • GPU compute: NVIDIA Ampere or newer architecture with Tensor Cores to accelerate the ViT backbone and cross‑attention layers.
  • CPU: 8‑core modern CPU (e.g., AMD Ryzen 7 5800X or Intel i7‑12700K) for pre‑processing and post‑processing; SSD storage to keep data pipelines fed.
  • Storage: Model size ≈ 1.2 GB (safetensors). Allocate at least 5 GB free for model files, cached datasets, and temporary buffers.
  • Performance characteristics: On a single RTX 3090, sam3 processes a 512 × 512 frame in ~33 ms (≈ 30 fps). Scaling to 1024 × 1024 roughly doubles latency, but still stays under 70 ms per frame with mixed‑precision (FP16) inference.

Use Cases

sam3’s fast, high‑quality mask generation makes it a versatile component across many domains:

  • Interactive image editing: Tools like Photoshop plugins can let users click on an object and instantly obtain a precise mask for background removal or recoloring.
  • Video post‑production: Real‑time segmentation enables automated rotoscoping, green‑screen replacement, and visual effects compositing.
  • Robotics & autonomous systems: On‑board perception pipelines can segment obstacles and manipulable objects from a single camera feed.
  • Medical imaging: Adapted with fine‑tuning, sam3 can outline anatomical structures in radiology scans, assisting radiologists in diagnosis.
  • Augmented reality (AR): Mobile AR apps can segment user‑captured objects to anchor virtual content accurately.

Integration is straightforward via Hugging Face’s pipeline("mask-generation") API, Azure ML endpoints, or custom Docker containers that load the safetensors checkpoint.

Training Details

Meta has not published a full training log for sam3, but the model follows a similar methodology to its predecessor SAM‑2:

  • Pre‑training data: A curated mix of image‑mask pairs from the SA‑1B dataset (≈ 1 billion masks) plus a video‑segmentation corpus (≈ 500 M frames) to teach temporal consistency.
  • Training regime: 300 k steps using AdamW, cosine learning‑rate decay, and mixed‑precision (FP16) on a cluster of 8 × NVIDIA A100 40 GB GPUs.
  • Loss functions: Combination of binary cross‑entropy for mask prediction, Dice loss for overlap optimization, and a contrastive prompt‑alignment loss.
  • Fine‑tuning capabilities: The model’s checkpoint can be fine‑tuned on domain‑specific datasets (e.g., medical CT scans) with a reduced learning rate (1e‑5) for 10 k steps, yielding a 5–10 % mIoU boost on target tasks.

The training compute footprint is estimated at ~ 2 PF‑days (petaflop‑days), reflecting the large‑scale data and transformer depth required for high‑fidelity mask generation.

Licensing Information

The model card lists the license as unknown. In practice, an “unknown” license means that the repository does not explicitly grant any rights, and users must treat the model as all‑rights‑reserved until clarified by the author. Consequently:

  • Commercial use: Not guaranteed. Organizations should seek explicit permission from Meta or verify that the model is covered by a permissive license (e.g., MIT, Apache‑2.0) before integrating it into revenue‑generating products.
  • Restrictions: Without a clear license, redistribution, modification, or inclusion in proprietary software may be prohibited.
  • Attribution: Even in the absence of a formal license, best practice is to credit the original author (“facebook”) and link to the Hugging Face model card.
  • Due‑diligence: Companies should consult legal counsel and, if possible, contact the model maintainer via the Hugging Face discussions page to request clarification.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives