Folio Orient for manuscripts

A 432 KB CPU model estimates which clockwise quarter-turn makes a scanned manuscript readable. It averages predictions from small patches of writing and sends low-agreement pages to review. The model was adapted on 26 handwritten register spreads from Freyung.

On 56 readable held-out spreads, it correctly accepted every rotation on 44, up from 11 for the original print model and 13 for a matched print-only continuation. On 55 spreads containing handwriting, the corresponding counts were 43, 10 and 12. One held-out spread was printed. A nearly blank opening was evaluated separately.

Try the two examples

The source loader reads config.json to select the ONNX weights. The configuration also records their SHA-256 digest and the graph鈥檚 input and output shapes.

hf download foliokestrel/folio-orient-manuscript \
  --include config.json \
  --include model.onnx \
  --include folio_orient.py \
  --include requirements.txt \
  --include 'examples/*.png' --local-dir manuscript
cd manuscript
python -m pip install -r requirements.txt
python folio_orient.py examples/recovered.png --no-deskew --output upright.png
python folio_orient.py examples/referred-error.png --no-deskew

The first image is an Otterskirchen register displayed on its side. All three models proposed the correct 270掳 clockwise turn. The manuscript model accepted it at 0.7924 agreement. The original print model referred it at 0.5712. In the second example, a sparsely filled ledger is already upright. The manuscript model's top guess of 270掳 is wrong. Its 0.3397 agreement sends the scan to review. These are the first qualifying cases in source-ID and rotation order. Source paths and per-model outputs

Pass your own image in place of either PNG. The CLI prints quarter_turn_cw, agreement, patches and accepted. The default acceptance threshold is 0.70. With --no-deskew, an accepted turn permutes pixels without interpolation. When agreement is low, the output preserves the displayed page direction. Check accepted before acting on the raw suggestion. agreement is a mean patch score and has no calibrated probability interpretation for new archives.

Review a handwritten PDF

The three-page letter example includes a sideways letter, a page with a filing note, and a page with writing in opposing directions. Run the PDF reviewer to get a tab-separated decision sheet, inspect each page, then apply your choices to a copy of the original. The worked sheet keeps the mixed-direction page as scanned. PDF commands and example 路 Download the letters

Held-out results

All three models use the same full two-scale inference, test images and acceptance threshold. There are 224 scored views of 56 readable sources, plus four views of one indeterminate opening. Each source contributes four related rotations.

Full-image test Original print Print continuation Manuscript
Correct raw directions / 224 206 205 222
Accepted / 224 85 88 186
Wrong among accepted 0 0 0
Sources correct on all four / 56 47 45 55
Sources correct and accepted on all four / 56 11 13 44
Suggestions accepted on the indeterminate opening / 4 3 3 0

Across the 56 readable sources, the manuscript model gained 33 complete four-rotation successes relative to the original and lost zero. Both of its incorrect raw directions came from the same sparse NAF ledger. Both were referred. These observed error counts apply to this sample. Per-view outputs and reproduction 路 Paired source IDs

Correct and accepted on every rotation Original print Print continuation Manuscript
Other Passau parishes, 16 sources 0 0 14
NAF ledgers, 18 3 4 13
Marburg, 18 including the printed spread 5 6 13
Bentham, 4 readable 3 3 4

Border sensitivity. Removing 8% from each edge before adding the rotation gave 45 complete four-rotation successes for the manuscript model, 9 for the original and 12 for the control. The manuscript model chose 217 of 224 raw directions correctly on these cropped images, compared with 222 on full images. It accepted 193 of the cropped views, all correct. Real scans can retain catalogue strips, printed form headings and other orientation cues. Cropped results

Print transfer. On Scan Recovery Bench the manuscript model accepted correct turns for 66 of 68 printed pages, compared with 65 for each print checkpoint. Each model also accepted one of 28 pages marked for review. The six natural-history books in that benchmark provide a limited check on print transfer. Print results 路 Scan Recovery Bench

Training, reference and limits

A single AI reviewer labeled the direction of writing on randomly rotated, neutrally identified scans before opening the rotation key. All 82 legible source scans were upright in the original archive files. The experimental quarter-turns are synthetic. The 26 Freyung scans were used for fitting and the 57 other scans were held out of fitting and orientation model selection. These sources were previously studied for a different task, locating the binding. The corpus consists of Western two-page openings. Single sheets, other scripts, reflections and fine skew need separate evaluation. Visual protocol 路 Training and comparison

The adapted weights, manuscript examples and adapted references are CC BY-SA 4.0. Original software, initial weights and the synthetic-only control are Apache 2.0. The cBAD source authors are Markus Diem, Florian Kleber, Stefan Fiel, Tobias Gr眉ning and Basilis Gatos. Each bundled example retains its archival path and image digest. Source dataset 路 Weight and data license 路 Software license

Downloads last month
36
Safetensors
Model size
108k params
Tensor type
F32
路
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support

Model tree for foliokestrel/folio-orient-manuscript

Quantized
(2)
this model