Skip to content

Add VLM-based Handwritten Text Recognition Pipeline (GSoC 2026 - Aniket Junghare) - #140

Open
junghare-aniket wants to merge 21 commits into
humanai-foundation:mainfrom
junghare-aniket:main
Open

Add VLM-based Handwritten Text Recognition Pipeline (GSoC 2026 - Aniket Junghare)#140
junghare-aniket wants to merge 21 commits into
humanai-foundation:mainfrom
junghare-aniket:main

Conversation

@junghare-aniket

Copy link
Copy Markdown
Contributor

Summary

This PR adds a VLM-centric end-to-end Handwritten Text Recognition (HTR) pipeline for early modern Spanish manuscripts, developed as part of GSoC 2026.

Unlike a traditional OCR-first approach, this pipeline places a Vision-Language Model (Qwen2.5-VL-7B-Instruct, LoRA fine-tuned) at the center of every processing stage: document analysis, literal reading, and correction, rather than using a VLM only as a late-stage corrector. A fine-tuned TrOCR model (developed during GSoC 2025) is used as an optional supplementary line-level OCR stage.

What's included

  • finetune.py — LoRA fine-tuning script for Qwen2.5-VL-7B-Instruct
  • inference.py — full 4-stage inference pipeline (VLM + optional TrOCR)
  • evaluate.py — CER/WER evaluation script
  • app/ — Gradio web app (same code deployed live on Hugging Face Spaces)
  • scripts/ — SLURM job scripts for fine-tuning, inference, and evaluation
  • Scoped README with setup instructions, evaluation results, and links to further resources

Results

Evaluated on the Rodrigo, Orinoco, and Tridis datasets. Full CER/WER tables and analysis are in the folder's README.

Try it live

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant