
sam2_hiera_tiny
Segmentation450 ops26.9M params
Segment Anything Model 2: promptable masks for images and video, mostly traced here as its Hiera encoder.
Segmentation · 598 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
timm.create_model('hieradet_small', pretrained=False) 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.
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.