microsoft / trocr-base-printed

huggingface.co
Total runs: 90.4K
24-hour runs: 0
7-day runs: 14.8K
30-day runs: -25.5K
Model's Last Updated: May 28 2024
image-to-text

Introduction of trocr-base-printed

Model Details of trocr-base-printed

TrOCR (base-sized model, fine-tuned on SROIE)

TrOCR model fine-tuned on the SROIE dataset . 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 .

Disclaimer: The team releasing TrOCR did not write a model card for this model so this model card has been written by the Hugging Face team.

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 BEiT, while the text decoder was initialized from the weights of RoBERTa.

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:

from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
import requests

# load image from the IAM database (actually this model is meant to be used on printed text)
url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")

processor = TrOCRProcessor.from_pretrained('microsoft/trocr-base-printed')
model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base-printed')
pixel_values = processor(images=image, return_tensors="pt").pixel_values

generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
BibTeX entry and citation info
@misc{li2021trocr,
      title={TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models}, 
      author={Minghao Li and Tengchao Lv and Lei Cui and Yijuan Lu and Dinei Florencio and Cha Zhang and Zhoujun Li and Furu Wei},
      year={2021},
      eprint={2109.10282},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Runs of microsoft trocr-base-printed on huggingface.co

90.4K
Total runs
0
24-hour runs
-1.9K
3-day runs
14.8K
7-day runs
-25.5K
30-day runs

More Information About trocr-base-printed huggingface.co Model

trocr-base-printed huggingface.co

trocr-base-printed huggingface.co is an AI model on huggingface.co that provides trocr-base-printed's model effect (), which can be used instantly with this microsoft trocr-base-printed model. huggingface.co supports a free trial of the trocr-base-printed model, and also provides paid use of the trocr-base-printed. Support call trocr-base-printed model through api, including Node.js, Python, http.

trocr-base-printed huggingface.co Url

https://huggingface.co/microsoft/trocr-base-printed

microsoft trocr-base-printed online free

trocr-base-printed huggingface.co is an online trial and call api platform, which integrates trocr-base-printed's modeling effects, including api services, and provides a free online trial of trocr-base-printed, you can try trocr-base-printed online for free by clicking the link below.

microsoft trocr-base-printed online free url in huggingface.co:

https://huggingface.co/microsoft/trocr-base-printed

trocr-base-printed install

trocr-base-printed is an open source model from GitHub that offers a free installation service, and any user can find trocr-base-printed on GitHub to install. At the same time, huggingface.co provides the effect of trocr-base-printed install, users can directly use trocr-base-printed installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

trocr-base-printed install url in huggingface.co:

https://huggingface.co/microsoft/trocr-base-printed

Url of trocr-base-printed

trocr-base-printed huggingface.co Url

Provider of trocr-base-printed huggingface.co

microsoft
ORGANIZATIONS

Other API from microsoft

huggingface.co

Total runs: 146.7M
Run Growth: -40.7M
Growth Rate: -27.76%
Updated: February 14 2024
huggingface.co

Total runs: 6.4M
Run Growth: 1.4M
Growth Rate: 21.58%
Updated: September 26 2022
huggingface.co

Total runs: 1.1M
Run Growth: 246.1K
Growth Rate: 21.98%
Updated: February 11 2025
huggingface.co

Total runs: 623.2K
Run Growth: 210.5K
Growth Rate: 33.77%
Updated: April 24 2023
huggingface.co

Total runs: 592.3K
Run Growth: 507.3K
Growth Rate: 85.21%
Updated: February 04 2025
huggingface.co

Total runs: 576.4K
Run Growth: -9.6M
Growth Rate: -1671.89%
Updated: February 12 2022
huggingface.co

Total runs: 416.5K
Run Growth: 248.6K
Growth Rate: 59.67%
Updated: April 30 2024
huggingface.co

Total runs: 365.6K
Run Growth: 142.7K
Growth Rate: 39.03%
Updated: February 03 2022
huggingface.co

Total runs: 353.3K
Run Growth: -252.8K
Growth Rate: -71.56%
Updated: February 28 2023
huggingface.co

Total runs: 143.3K
Run Growth: 13.8K
Growth Rate: 9.65%
Updated: November 08 2023
huggingface.co

Total runs: 120.3K
Run Growth: 54.0K
Growth Rate: 44.85%
Updated: April 08 2024
huggingface.co

Total runs: 118.8K
Run Growth: 17.6K
Growth Rate: 14.81%
Updated: April 30 2024
huggingface.co

Total runs: 90.3K
Run Growth: 31.9K
Growth Rate: 35.34%
Updated: December 23 2021
huggingface.co

Total runs: 73.7K
Run Growth: -142.2K
Growth Rate: -192.97%
Updated: February 03 2023
huggingface.co

Total runs: 51.6K
Run Growth: 26.8K
Growth Rate: 53.54%
Updated: December 21 2024
huggingface.co

Total runs: 39.7K
Run Growth: 13.6K
Growth Rate: 32.63%
Updated: January 09 2025
huggingface.co

Total runs: 36.0K
Run Growth: 25.0K
Growth Rate: 77.27%
Updated: October 22 2024
huggingface.co

Total runs: 34.3K
Run Growth: 26.5K
Growth Rate: 77.31%
Updated: November 23 2023
huggingface.co

Total runs: 20.8K
Run Growth: 7.9K
Growth Rate: 37.96%
Updated: February 29 2024
huggingface.co

Total runs: 19.8K
Run Growth: -117.4K
Growth Rate: -591.46%
Updated: September 26 2022
huggingface.co

Total runs: 17.4K
Run Growth: -52
Growth Rate: -0.30%
Updated: June 27 2023
huggingface.co

Total runs: 14.7K
Run Growth: 3.4K
Growth Rate: 23.33%
Updated: November 23 2023