🚀 中世紀草書TrOCR模型
這是一個用於中世紀草書的TrOCR模型,能夠將中世紀草書寫的圖像轉換為文本。該模型基於預訓練模型微調而來,為中世紀手寫文字識別提供了有效的解決方案。
🚀 快速開始
模型簡介
這是一個用於中世紀草書的TrOCR模型。基礎模型為 microsoft/trocr-base-handwritten。該模型先針對卡羅琳字體進行微調:medieval-data/trocr-medieval-latin-caroline,之後再從保存的檢查點進一步針對草書進行微調。
訓練使用的數據集為 CATMuS。
該模型尚未經過正式測試,初步檢查表明還需要進一步微調。
微調使用的是此倉庫中的 finetune.py
文件。
模型信息
屬性 |
詳情 |
模型類型 |
用於中世紀草書的TrOCR模型 |
訓練數據 |
CATMuS |
支持語言
示例展示
💻 使用示例
基礎用法
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
import requests
url = "https://huggingface.co/medieval-data/trocr-medieval-cursiva/resolve/main/images/cursiva-1.png"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
processor = TrOCRProcessor.from_pretrained('medieval-data/trocr-medieval-cursiva')
model = VisionEncoderDecoderModel.from_pretrained('medieval-data/trocr-medieval-cursiva')
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引用和引用信息
TrOCR論文
@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}
}
CATMuS論文
@unpublished{clerice:hal-04453952,
TITLE = {{CATMuS Medieval: A multilingual large-scale cross-century dataset in Latin script for handwritten text recognition and beyond}},
AUTHOR = {Cl{\'e}rice, Thibault and Pinche, Ariane and Vlachou-Efstathiou, Malamatenia and Chagu{\'e}, Alix and Camps, Jean-Baptiste and Gille-Levenson, Matthias and Brisville-Fertin, Olivier and Fischer, Franz and Gervers, Michaels and Boutreux, Agn{\`e}s and Manton, Avery and Gabay, Simon and O'Connor, Patricia and Haverals, Wouter and Kestemont, Mike and Vandyck, Caroline and Kiessling, Benjamin},
URL = {https://inria.hal.science/hal-04453952},
NOTE = {working paper or preprint},
YEAR = {2024},
MONTH = Feb,
KEYWORDS = {Historical sources ; medieval manuscripts ; Latin scripts ; benchmarking dataset ; multilingual ; handwritten text recognition},
PDF = {https://inria.hal.science/hal-04453952/file/ICDAR24___CATMUS_Medieval-1.pdf},
HAL_ID = {hal-04453952},
HAL_VERSION = {v1},
}
📄 許可證
本項目採用MIT許可證。