🗺️

Segmentation - SAM2 (Scene)

🛠

Segmenting any object in any image

SAM2 (Segment Anything Model 2) is Meta's powerful segmentation model that automatically detects and extracts every object in an image without any manual interaction. Upload an image and SAM2 identifies all distinct objects with pixel-perfect precision.

What it does

SAM2 automatically segments (extracts) every object in an image. Upload a photo, and SAM2 analyzes it to find all distinct objects—people, animals, items, backgrounds - and creates precise masks for each. The model learns from Meta's largest segmentation dataset, so it understands virtually any object category and can find objects even in complex scenes with multiple items.

Problem it solves

  • Universal segmentation – Works on any object without custom training
  • Multi-object extraction – Simultaneously segments all objects in an image
  • Data annotation speedup – Faster than manual pixel-by-pixel selection
  • Precise boundaries – Pixel-accurate segmentation masks for each object
  • Complex scene handling – Works with cluttered backgrounds and multiple objects

Input/Output

  • Input: RGB image file (any resolution)
  • image
  • Output: Individual binary mask for each detected object
    • Segmentation masks: Individual binary mask for each detected object
    • Text output: Summary with detection details
      • Object ID (object_0, object_1, etc.)
      • RGB color code for visualization
      • Confidence score (0-1, higher is better)
      • Bounding box: [x, y, width, height]
    • Total object count: Number of objects detected
    • image

Performance

  • Segmentation Quality:
    • Tiny: Good accuracy, fastest processing
    • Small: Very good accuracy, balanced speed
    • Large: Excellent accuracy, slower processing
  • Performance by Object Type:
    • Clean objects: 95%+ accuracy
    • Complex backgrounds: Excellent boundary precision
    • Multiple objects: Segments each separately and accurately
    • Fine details: Excellent at capturing small features
    • Partially visible objects: Good at detecting partially visible items
    • Overlapping objects: Handles overlapping items

Technical Details

Architecture
Vision Transformer with automatic mask generation
Core Innovatio
Automatic panoptic segmentation with zero-shot capability
Components
• Image Encoder: ViT-based backbone extracts image features • Automatic Mask Generator: Produces masks for all objects without prompts • Mask Decoder: Generates high-quality segmentation masks
Training
• Base Model: Facebook's research implementation (SAM2) • Dataset: Trained on 1.1B+ image segmentation masks (SA-1B and additional data) • Segmentation expertise across diverse image types and domains
Requirements
• PyTorch with CUDA • 8GB+ VRAM (varies by model size) • GPU recommended (CPU possible for small models)

Compliance & Provenance

Provider
Meta (open)
Provider type
Specialized
License
Apache 2.0
EU AI Act risk class
Minimal Risk
Art. 50 transparency
Not applicable
Region availability
Available globally
Training data summary

For more on how we classify models and mark outputs, see our AI Policy.

Model Source