All models

hieradet_small

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

Segmentation · 598 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 (34 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
34.7M
Operations
598
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
m5346
Graph hash
2cee9e71ebb1118e9fd9dd2455030cfcb773bb0e42879f8ef06c1af8b2448648
Skeleton hash
17117c4df5b86767b1feaa5bc8c3189887770d75bca53d6cd9d333c8e7dbf81b
Architecture hash
4668447ee6342a5399fb2a61cdc10d65605d5c8c9b080af14858fb869babbc79
Diagram SHA-256
b03c8c2d5ac9015aab7784700d5690527d626c768c39330c3a94061dc29fc874
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('hieradet_small', 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.