All models

sam (MMPretrain)

Promptable segmentation model that returns a mask for any object given points or boxes.

Segmentation · 160 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 (25 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
sam
Parameters
731.4K
Operations
160
Framework
PyTorch
Recurrent
No
Source
transformers 5.18.0
Name in source
mmpretrain:sam
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
m6998
Graph hash
b49ec1cb9ae3e9447f1b367261ac4238404105e81023ae17eb7f05a60547aef1
Skeleton hash
2ad84469cc49199b62a0a3fb4d09bf5c3fb9d70937604abf1618f8454c5d01a8
Architecture hash
60ee6fd2d4662b37bcca79d9aec686af451982c4817a05e3b56cca507dac77fb
Diagram SHA-256
64010527cdc81914bac1dd644de6f83d7f26ddd96623ed62d8b97d0db419cfec
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

menagerie.classics.wave_b_openmmlab:build_mmpretrain: build({})

What it is

About this model's family

SAM, the Segment Anything Model, predicts a segmentation mask for any object of interest in an image once you point at it. It was built to be promptable: the prompts are 2D points, bounding boxes or a prior mask, and that design is what lets it transfer zero-shot to new image distributions and tasks. Behind it sits SA-1B, a dataset of over 1 billion masks on 11M licensed images, collected in a loop with the model itself. Zero-shot, the authors found it often competitive with or better than prior fully supervised results.

In practice the output is a binary mask, results improve markedly with point or box prompts, and several points can be combined to predict one mask. The paper describes text prompts too, but the library notes these were not supported in the official repository at the time of writing. The traced member here is the image encoder on its own, the SAM vision model, rather than the full prompt-encoder and mask-decoder pipeline.

Key idea. A promptable segmentation model that takes points, boxes or masks as prompts and transfers zero-shot, trained on SA-1B with over 1 billion masks on 11M images.

  • SAM
  • Segment Anything
  • Segment Anything Model
  • SA-1B
  • promptable segmentation
  • mask generation
  • zero-shot segmentation
  • SlimSAM
  • Grounded SAM

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