All models

sam2_hiera_tiny

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

Segmentation · 450 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 (29 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
26.9M
Operations
450
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
m9016
Graph hash
5313ef757f48ade90db3e2f22c51aff2b64908ece5447a66d38b1750c1f0158c
Skeleton hash
64f166c861329092edea660e9749c9fa63ef50b2b2d27607a2186360e66bcd6e
Architecture hash
3d65af79f3a496fddd9ae4cea929cf99fb78fb93a333a47bfa675a979eb580e4
Diagram SHA-256
bbd8f7098c7cd212e02d35ba52944fe6e87e0a446d6de45c63f9fabcbfd17818
TorchLens version
2.35.3
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_tiny', 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.