alt.freeweights.vision / trocr-base-handwritten
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.visionSubject:

trocr-base-handwritten

Date: 2026-11-14Commit: eaacaf4Signed: 2DC28CC7B26A283B ✓

Image to text model with 333M parameters. Safetensors weights, 2.67 GB in all. Published by microsoft under MIT.

333M params2.67GBtrocr-base-handwrittensafetensorspermissive
FactsParams333MSize2.67 GBFormatssafetensorsTaskimage to textLicenseMITFrom sourcepermissive
$ fw get microsoft/trocr-base-handwritten
# manifest sha256 e0798bce90b3… · 2.67 GB · 11 files
$ fw verify ./trocr-base-handwritten microsoft/trocr-base-handwritten
From sourceHosted (signed)microsoft/trocr-base-handwrittenLast check: 2026-11-14 21:23 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Overview

Size
2.67 GB
Weights
1.33 GB (safetensors)
Parameters
333M
Formats
safetensors
Task
image to text
License
MIT (permissive)
Files
11, each with a sha256
Publisher
microsoft
Added
2026-11-14
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:23 UTCpassed

Model card

From the publisher at commit eaacaf4. Shown as plain text with links; images open at the publisher.

TrOCR (base-sized model, fine-tuned on IAM)#

TrOCR model fine-tuned on the IAM 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
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-handwritten')
model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base-handwritten')
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}
}

Files

11 files · 2.67 GBWeights 1.33 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 11 files with their sha256
FileSizesha256
.gitattributes1.23 KB98ccb431c012ebfe976280fbd45aea4cec7409935868ccecf3954370f96732a1
README.md3.00 KB9f808e1fc12dcb61c89a38f00303506dbc85db8ea988cec441a9324e0c8f2843
config.json4.17 KB4c779f24e063c437c3dafd5b2e6c9f59f2fa2bd1dbb4ae6a30153bbbbf19e647
generation_config.json190 B41149cdcffec4d657f32dfcddd9b208037f01286c9e07945c724908c58ed0193
merges.txt456 KB1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5
model.safetensors1.33 GB25a40cddc7e6120140a3d5b9e3dd3878a92ada7b4f312953ab22edc19c2a5acc
preprocessor_config.json224 B2fcc0da9466ee00be0403b26027373039e032820ebac409e207b32e52e52119d
pytorch_model.bin1.33 GBd1091e5a98ff3b31cddcaa21423171be74e6d270128896e9edd0f6394e2a9978
special_tokens_map.json772 Bc611b1f7d416eb001ee4f293d903ea8c88e703463f1d403f1866a0352743fd00
tokenizer_config.json1.12 KB5a1356884c6ae736a621841535264ba7c5bebd52f169258add2c48fcbb32d50a
vocab.json899 KB06b4d46c8e752d410213d9548eb27a54db70fda0319b6271fb8d59dead5e1cab
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
eaacaf452b pinned now manifest updated, same commit2026-11-14 21:23 UTC11 files · 2.67 GB
eaacaf452b2026-11-14 21:23 UTC11 files · 2.67 GB

Use it

$ fw get microsoft/trocr-base-handwritten
# manifest sha256 e0798bce90b3… · 2.67 GB · 11 files
$ fw verify ./trocr-base-handwritten microsoft/trocr-base-handwritten
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/trocr-base-handwritten.json --dir ./trocr-base-handwritten $ python3 fw.py verify ./trocr-base-handwritten ./microsoft__trocr-base-handwritten.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/trocr-base-handwritten --revision eaacaf452b06415df8f10bb6fad3a4c11e609406 --local-dir ./trocr-base-handwritten

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
9f808e1fc12dcb61c89a38f00303506dbc85db8ea988cec441a9324e0c8f2843
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.visionSubject: trocr-base-handwrittenDate: 2026-11-14Commit: eaacaf4Signed: 2DC28CC7B26A283B ✓
Upstream
microsoft/trocr-base-handwritten
Pinned commit
eaacaf452b06415df8f10bb6fad3a4c11e609406
Manifest
trocr-base-handwritten.json · .minisig
Manifest sha256
e0798bce90b3d64091822dc30cdb5ee7afe223f25067cd3180e52a23822dd379
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:23 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/trocr-base-handwritten.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/trocr-base-handwritten.json.minisig $ minisign -Vm trocr-base-handwritten.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/trocr-base-handwritten
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. trocr-base-handwritten.json. Provenance. Takedown history: none.
From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX