Install Folio Fold 0.5.0 and extract OCR line images from an existing batch
Browse filesFiles changed (2)
- README.md+13-1
- config.json+3-3
24 unmodified lines252627282829303159 unmodified lines91929394959697989910010110210310410510610710824 unmodified lines
Install the wheel from this repository. It includes the 703 KB ONNX weights, the offline review page and its fonts. The command prints the fold endpoints as JSON and can draw an overlay on a new PNG.
With the Hugging Face CLI (`hf`) installed, download the model configuration and wheel installer. The installer reads the pinned wheel revision from `config.json` and pip checks its SHA-256 digest. For pip without the Hub CLI, use the [versioned wheel](https://huggingface.co/foliokestrel/folio-fold/resolve/f65b99422c2c3e65c23ba513ef5fd3f970549200/wheels/folio_fold-0.4.2-py3-none-any.whl).With the Hugging Face CLI (`hf`) installed, download the model configuration and wheel installer. The installer reads the pinned wheel revision from `config.json` and pip checks its SHA-256 digest. For pip without the Hub CLI, use the [versioned wheel](https://huggingface.co/foliokestrel/folio-fold/resolve/9b2e0ec946460d9f85f65c4dcdcc6fd83a67a24b/wheels/folio_fold-0.5.0-py3-none-any.whl).
```shhf download foliokestrel/folio-fold config.json install_wheel.py --local-dir folio-fold-install59 unmodified lines
A baseline can end in the margin beyond the last written character. A low count can also occur on a misplaced cut through a blank part of a page. The benchmark includes full-resolution examples of both a cut through a word and a crossing beside the writing. [Annotated examples and PAGE scorer](https://huggingface.co/datasets/foliokestrel/folio-spread-bench/blob/main/text-lines/README.md)
### Extract OCR line images after exporting a batch
With an exported batch and its original PAGE XML annotations, create one PNG per usable text-line rectangle. The command reads from the exported pages. You can run it after moving the source scans offline.
~~~shfolio-fold-batch crop-lines ./pages/pages.json ./scans/page ./line-crops~~~
Open `line-crops/lines.jsonl` to find each PNG by original scan name, PAGE line ID and source coordinates. Each line’s `crop` is relative to the output directory. Transcription alternatives and their original attributes are included when the XML supplies them. A line crossing the cut gets one complete crop assembled from the two pages. Whole-page exports work with the same command.
Add `--crossings-only` to write PNGs just for the divided lines. The index still lists the other lines and their page coordinates. Missing or unusable contours carry a review reason. In the two-scan example, the default writes 82 crops and the flag writes three. [Download the example batch and PAGE files](https://huggingface.co/datasets/foliokestrel/folio-spread-bench/resolve/main/text-lines/split-crops/batch/batch-lines.zip?download=true)
### Start from a library manifest, TIFF or archive book
For an Internet Archive book, select leaves from the JPEG 2000 ZIP and review each proposed cut. The worked example includes the original scan labels and right-to-left reading order. [Review a JPEG 2000 book](examples/archive-jp2/README.md)30 unmodified lines313233343536343536373830 unmodified lines "no_fold_class": 80, "wheel": { "package": "folio-fold", "file": "wheels/folio_fold-0.4.2-py3-none-any.whl", "sha256": "9196d1edeb1cb54535cac6648d7058a382d4647da6321534b44e3b805b29dc80", "revision": "f65b99422c2c3e65c23ba513ef5fd3f970549200" "file": "wheels/folio_fold-0.5.0-py3-none-any.whl", "sha256": "3640d4b0f310c7699d2e90f3e85dd16767dabd31351ef289d10069d30eaee5ef", "revision": "9b2e0ec946460d9f85f65c4dcdcc6fd83a67a24b" }}README.md+13-1
config.json+3-3