| --- |
| library_name: chant-omr |
| tags: |
| - omr |
| - gregorian-chant |
| - gabc |
| - openvino |
| - onnx |
| - square-notation |
| license: mit |
| pipeline_tag: image-to-text |
| --- |
| |
| # ChantOMR |
|
|
| End-to-end Optical Music Recognition for Gregorian chant square notation. |
| Converts photographs of historical chant manuscripts into |
| [GABC](https://gregorio-project.github.io/gabc/) notation. |
|
|
| Based on [Transcoda](https://huggingface.co/btrkeks/transcoda-59M-zeroshot-v1)'s |
| ConvNeXt-V2 + Transformer architecture (~59M params), retrained from scratch |
| on ~20,000 [GregoBase](https://gregobase.selapa.net/) scores with domain |
| augmentation for square notation. |
|
|
| ## Model Details |
|
|
| | Property | Value | |
| |----------|-------| |
| | Architecture | ConvNeXt-V2 Tiny encoder + 8-layer Transformer decoder | |
| | Parameters | ~59M | |
| | Input | Score image (width 1050, variable height) | |
| | Output | GABC token sequence | |
| | Vocabulary | ~2048 BPE tokens | |
| | Training data | GregoBase (~20k scores, synthetic renders + augmentation) | |
| | Framework | PyTorch / Lightning | |
|
|
| ## Evaluation |
|
|
| No evaluation results available yet. |
|
|
| ## Formats |
|
|
| This repository contains the model in multiple formats: |
|
|
| | Format | Files | Use case | |
| |--------|-------|----------| |
| | **Safetensors** | `model.safetensors` | PyTorch fine-tuning or inference | |
| | **OpenVINO IR** | `openvino/*.xml` + `.bin` | Production inference on Intel hardware | |
| | **ONNX** | `onnx/*.onnx` | Portable inference on any hardware | |
|
|
| ## Quick Start |
|
|
| ### CLI (easiest) |
|
|
| ```bash |
| pip install chant-omr |
| chant-omr predict score.png --model pgquiles/chant-omr --device openvino |
| ``` |
|
|
| ### Python (OpenVINO) |
|
|
| ```python |
| from chant_omr.hub import download_from_hub |
| from chant_omr.inference.ov_decode import load_openvino_models, ov_predict_gabc |
| |
| model_dir = download_from_hub("pgquiles/chant-omr") |
| gabc = ov_predict_gabc( |
| "score.png", |
| model_dir / "openvino", |
| beam_width=3, |
| ) |
| print(gabc) |
| ``` |
|
|
| ### Python (PyTorch) |
|
|
| ```python |
| from chant_omr.hub import download_from_hub |
| from chant_omr.inference.checkpoint import load_model_from_safetensors |
| from chant_omr.inference.predict import predict_gabc_from_hub |
| |
| model_dir = download_from_hub("pgquiles/chant-omr") |
| gabc = predict_gabc_from_hub("score.png", model_dir) |
| print(gabc) |
| ``` |
|
|
| ## Limitations |
|
|
| - Trained on synthetic Gregorio renders; real manuscript accuracy depends on |
| scan quality and augmentation coverage. |
| - Square notation only (no modern staff notation, no NABC/adiastematic neumes). |
| - Single-system images work best; multi-system page layout analysis is handled |
| by [ghh](https://github.com/pgarciaq/ghh), not this model. |
|
|
| ## Links |
|
|
| - **Code:** [github.com/pgarciaq/chant-omr](https://github.com/pgarciaq/chant-omr) |
| - **Pipeline:** [github.com/pgarciaq/ghh](https://github.com/pgarciaq/ghh) |
| - **Training data:** [GregoBase](https://gregobase.selapa.net/) |
|
|
| --- |
| *Uploaded with chant-omr v0.1.0* |
|
|