
DePlot-Pix2Struct
Documents and OCR1,592 ops282.3M params
Image-to-text model pretrained by parsing masked web screenshots into HTML.
Documents and OCR · 1,592 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.
Pix2Struct is a pretrained image-to-text model for purely visual language understanding: it reads text where it sits in the picture, from textbook diagrams to web pages and app screens. Its pretraining task is to parse masked screenshots of web pages into simplified HTML, a signal the authors argue subsumes OCR, language modeling and captioning at once. Two design choices follow: a variable-resolution input representation, and prompts such as questions rendered directly onto the input image rather than fed as separate text.
The paper reports a single pretrained model reaching state-of-the-art results in six of nine tasks across documents, illustrations, user interfaces and natural images. The released checkpoints are fine-tuned per task, and the library advises using the one matching your task, such as the UI-captioning model for UI captioning. The traced member is Pix2StructForConditionalGeneration, the encoder-decoder that turns flattened image patches into text tokens.
Key idea. Screenshot parsing as pretraining: Pix2Struct learns visually-situated language by converting masked web screenshots into simplified HTML, with variable-resolution inputs and prompts rendered onto the image.
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.