Model Card for Sprakbanken/TrOCR-norhand-v3

This is a TrOCR-model for OCR (optical character recognition) of handwritten historic documents written in Norwegian.
It can be used to recognize text in images of handwritten text.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image

processor = TrOCRProcessor.from_pretrained("Sprakbanken/TrOCR-norhand-v3")
model = VisionEncoderDecoderModel.from_pretrained("Sprakbanken/TrOCR-norhand-v3")

image = Image.open("path_to_image.jpg").convert("RGB")

pixel_values = processor(image, return_tensors="pt").pixel_values
generated_ids = model.generate(pixel_values)

generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]

Model Details

This model is microsoft/trocr-base-handwritten fine-tuned on the Huggingface version of the NorHand v3 dataset.

Model Description

Uses

You can use the raw model for handwritten text recognition (HTR) on single text-line images in Norwegian.

Out-of-Scope Use

The model only works with images of lines of text. If you have images of entire pages of text, you must segment the text into lines first to benefit from this model.

Downloads last month
55
Safetensors
Model size
334M params
Tensor type
F32
·
Inference API
Inference API (serverless) does not yet support transformers models for this pipeline type.

Model tree for Sprakbanken/TrOCR-norhand-v3

Finetuned
(8)
this model