Instructions to use horatio12/passenger-list-handwriting-reader with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use horatio12/passenger-list-handwriting-reader with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="horatio12/passenger-list-handwriting-reader")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("horatio12/passenger-list-handwriting-reader") model = AutoModelForMultimodalLM.from_pretrained("horatio12/passenger-list-handwriting-reader", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Passenger list handwriting reader
Reads one handwritten name from a strip cut out of a US ship passenger list. Fine-tuned from the National Archives of Finland's multicentury-htr-model on name strips from New York arrival lists, 1897 to 1957 (National Archives microfilm T715, scanned on archive.org). Many names are Eastern and Southern European, as written by American clerks and ship officers.
Part of passenger-list-reader. Strips were cut with kraken's line finder, so it reads those best. For typed strips use passenger-list-typed-reader.
Use
from PIL import Image
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
proc = TrOCRProcessor.from_pretrained("horatio12/passenger-list-handwriting-reader")
model = VisionEncoderDecoderModel.from_pretrained("horatio12/passenger-list-handwriting-reader").eval()
pix = proc(images=Image.open("strip.png").convert("RGB"), return_tensors="pt").pixel_values
ids = model.generate(pix, max_new_tokens=48, interpolate_pos_encoding=pix.shape[-1] != pix.shape[-2])
print(proc.batch_decode(ids, skip_special_tokens=True)[0])
Results
On 23 handwritten pages from reels nothing was trained on, counting only names where two independent reads agree on the truth: 559 of 744 words right (75.1%), 178 full names right, 7.5% of letters wrong.
Training labels
Each strip was read twice by Claude (some also by Gemini), and only names where the reads agreed were kept. They were not checked by a person, so hard handwriting is underrepresented.
Limits
Tuned for short name strips, not for running handwriting. Untested on other ports. Hard or faded hands are much less accurate than the average above.
License
Apache 2.0, the same as the base model.
- Downloads last month
- 38
Model tree for horatio12/passenger-list-handwriting-reader
Base model
microsoft/trocr-large-handwritten