All models

sam2_hiera_base_plus

Segment Anything Model 2: promptable masks for images and video, mostly traced here as its Hiera encoder.

Segmentation · 894 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (35 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
sam2
Parameters
68.7M
Operations
894
Framework
PyTorch
Recurrent
No
Published
2024
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m9013
Graph hash
bf00afcf20dc2bd629456bffdba2838ff945f373973119921e6a26510509ae82
Skeleton hash
118c4700677ce32a1896f7d26c172f660cbd4315488a89fb1900ccb1899b4dc8
Architecture hash
950fe2c1c8a0e5bcb2070249c98cdda95b8a87dea6c58a9ef1f2b7ab9479b990
Diagram SHA-256
e683ce429f52883d4fc13884c312d2e0e1347c09b40a9d578f0942003daf9449
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('sam2_hiera_base_plus', pretrained=False)

What it is

About this model's family

SAM2, the Segment Anything Model 2, is a foundation model for promptable visual segmentation in images and videos. Given an image or video plus input points or bounding boxes, it predicts segmentation masks for any object of interest.

The architecture is a simple transformer with streaming memory for real-time video processing, trained on a dataset collected with a data engine that improves model and data through user interaction. The paper reports better video segmentation accuracy with 3x fewer interactions than prior approaches, and image segmentation that is more accurate and 6x faster than the original Segment Anything Model.

The Transformers port exposes the pieces separately: a Sam2HieraDetModel image encoder, a Sam2VisionModel, and the full Sam2Model with its prompt encoder and mask decoder. Most of the members traced here are that Hiera encoder alone, as timm packages it; one member is the full Sam2Model built from a default configuration.

Key idea. Promptable segmentation extended from images to video with a streaming-memory transformer and a data engine.

  • sam2
  • sam 2
  • sam2.1
  • segment anything model 2
  • segment anything
  • segment anything in images and videos
  • promptable segmentation
  • hiera
  • hieradet
  • sam2_hiera_tiny
  • sam2_hiera_large
  • mask generation
  • video segmentation
  • meta

AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.