A prompt encoder converts a segmentation prompt into an embedded vector that a mask decoder can combine with an image embedding. In Segment Anything, the prompt identifies the object to segment through either a point inside it or a box around it. section 11.3.2
A typical prompt-to-mask workflow is:
- Encode the input image into a compact image embedding. section 11.3.2
- Choose a point prompt or a box prompt and map it to a prompt embedding. section 11.3.2
- Pass both embeddings to the mask decoder to produce several possible object masks. section 11.3.2
Training prompt inputs
Sample an image and an object mask, then randomly choose a point inside the mask or a box surrounding it. Pair the image and prompt with the ground-truth mask. section 11.3.2
Figure 11.8 The Segment Anything high-level architecture overview
Use the architecture overview to see how the image encoder, prompt encoder, and mask decoder fit together. section 11.3.2
