TrOCR (small sized model, pre trained only) TrOCR pre trained only model. It was introduced in the paper TrOCR: Transformer based Optical Character Recognition with Pre trained Models by Li et al. and first released in this repository. Model description The TrOCR model is an encoder decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of DeiT, while the text decoder was initialized from the weights of UniLM. Images are presented to the model as a sequence of fixed size patches (resolution 16x16), which are linearly embedded. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder. Next, the Transformer text decoder autoregressively generates tokens. Intended uses & limitations You can use the raw model for optical character recognition (OCR) on single text line images. See the model hub to look for fine tuned versions on a task that interests you. How to use Here is how to use this model in PyTorch: BibTeX entry and citation info
We use cookies for essential functionality and analytics. You can accept or reject analytics cookies.Cookie policy