All models

clipseg (base text guided segmentation)

Frozen CLIP ViT-B/16 plus a tiny FiLM-conditioned transformer decoder that segments whatever a text or image prompt names.

Segmentation · 693 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 (33 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
CLIPSeg
Parameters
150.7M
Operations
693
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
38 (as of 5 October 2026)
Authors
Timo Lüddecke, Alexander S. Ecker
Name in source
clipseg:base-text-guided-segmentation
License
MIT
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
m3787
Graph hash
fa1909c6c36b92cfe433fc7c33b62226485098d2b000e10bb5b19f81b956318e
Skeleton hash
ad43de1cdb1d9b27bf27adb1a244f94ba609103203af764f3105012d69c1d183
Architecture hash
0a9d6f12824a56c4970fef2aa4f24276cd2b888b1e4abdc71503e618cc6e302b
Diagram SHA-256
5d7a8a58e11345128bdce08d8243e650a25c730678394ddfc183af88b6f3691c
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

What it is

About this model's family

CLIPSeg is Timo Lüddecke and Alexander S. Ecker's prompt-driven segmenter: instead of a fixed set of object classes, it can generate image segmentations based on arbitrary prompts at test time, and a prompt can be either a text or an image. That flexibility lets one model, trained once, cover three segmentation tasks with distinct challenges: referring expression segmentation, zero-shot segmentation and one-shot segmentation. The authors also find the system adapts well to generalized queries involving affordances or properties.

The backbone is the visual transformer-based (ViT-B/16) CLIP model, extended with a small, parameter-efficient transformer decoder, and CLIP itself is not trained, but only used as a frozen feature extractor. The decoder is a simple, purely-transformer based decoder, which has U-Net-inspired skip connections to the CLIP encoder that allow the decoder to be compact (in terms of parameters). To tell the decoder what to segment, the authors modulate the decoder's input activation by a conditional vector using FiLM, a vector that comes either from the CLIP text-transformer embedding of a text query or from the CLIP visual transformer on a feature engineered prompt image. CLIP activations are read out at layers S = [3, 7, 9], so the decoder has only three layers, and with a projection dimension of D = 64 CLIPSeg has only 1,122,305 trainable parameters. Training was on PhraseCut+, an extended version of the PhraseCut dataset, after which the system generates a binary segmentation map for an image based on a free-text prompt or on an additional image expressing the query.

Both members here are the transformers port of the authors' rd64-refined weights, which the Hub card describes as the CLIPSeg model with reduce dimension 64, refined (using a more complex convolution), intended for zero-shot and one-shot image segmentation. The segmentation member returns per-pixel classification scores for each pixel at the 352 px the paper used throughout its experiments, while the second member is the bare CLIPSeg model whose outputs are the scaled dot product scores between image_embeds and text_embeds, the CLIP-style similarity without the decoder. The original CLIP is constrained to a fixed image size due to the learned positional embedding, so the authors interpolate those embeddings to allow other sizes, and for ViT-B/16 performance only decreases for images larger than 350 pixels. CLIPSeg was integrated into the HuggingFace Transformers library in November 2022, and the paper was accepted to CVPR 2022.

Key idea. A compact transformer decoder with U-Net-style skips into a frozen CLIP ViT-B/16, FiLM-conditioned on a text or image prompt, producing a binary mask for any query.

  • clipseg
  • clip seg
  • clipdensepredt
  • clipseg-rd64-refined
  • image segmentation using text and image prompts
  • text-guided segmentation
  • zero-shot segmentation
  • one-shot segmentation
  • referring expression segmentation
  • luddecke ecker
  • clip segmentation

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lüddecke2022imagesegmentationusingtext,
      title={Image Segmentation Using Text and Image Prompts}, 
      author={Timo Lüddecke and Alexander S. Ecker},
      year={2022},
      eprint={2112.10003},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2112.10003}, 
}