Skip to content

Repository files navigation

Notes2Tone

OMR benchmarking framework for evaluating music score transcription models on the PRAIG/SMB dataset.

Requirements

  • Python 3.10+
  • HuggingFace account for dataset access

Installation

1. Clone notes2tone Repository

git clone https://github.com/yourusername/notes2tone.git
cd notes2tone

2. Create Conda Environment

conda create -n notes2tone python=3.12 -y
conda activate notes2tone

3. Install notes2tone

cd /notes2tone
pip install -e .

4. Install HOMR

# Clone repository
cd ~/work  # or your preferred location
git clone https://github.com/liebharc/homr.git
cd homr

# Install Poetry
pip install poetry
poetry config virtualenvs.create false

# Install dependencies
poetry install --only main,gpu  # For GPU support
# or: poetry install --only main  # For CPU only
# or: poetry install  # For development

# Test installation
poetry run homr <image_path>

5. Install Audiveris

  • Windows: Download .msi from releases
  • Linux: use install script to install localy or download .deb or use Flatpak from Flathub
chmod +x audiveris_setup.sh
./audiveris_setup.sh
  • macOS: Download .dmg from releases
  • Build it yourselfe: Requires Java 11+ (download here)

6. Setup HuggingFace Authentication

Create .env file in notes2tone project root:

HF_TOKEN=your_token_here

Get token: https://huggingface.co/settings/tokens
Request access: https://huggingface.co/datasets/PRAIG/SMB

Quick Start

Run Benchmark

# Benchmark all models
python -m benchmarks.benchmark --models all --limit 10

# Benchmark specific models
python -m benchmarks.benchmark --models oemer homr --limit 1

Browse Dataset

python dataset_viewer.py

Run Audiveris Pipeline

python -m benchmarks.audiveris_pipeline \
  --audiveris-path /path/to/Audiveris \
  --audiveris-upscale-factor 2.0 \
  --audiveris-upscale-max-side 3500

If Audiveris skips many pages because staff lines are too close, increase --audiveris-upscale-factor (e.g. 2.5).

Project Structure

benchmarks/
├── datasets/      # Dataset loaders (SMB)
├── models/        # OMR model wrappers (OeMeR, homr, Audiveris)
├── converters/    # MusicXML → **kern
├── eval/          # OMR-NED metrics
└── benchmark.py   # Main CLI

Adding Models

Create class in benchmarks/models/:

from benchmarks.models.base_model import BaseOMRModel

class MyModel(BaseOMRModel):
    def _predict_impl(self, image_path: str, debug_dir: Path) -> str:
        # Return **kern notation
        return kern_output

Register in benchmarks/benchmark.py.

Troubleshooting

GPU not working:

nvidia-smi
nvtop

HF authentication error: Check .env file and dataset access request

First run slow: Model compilation takes 2-5 min initially

Metrics

OMR-NED: Normalized Edit Distance (lower = better, 0.0 = perfect)

Paper

Acknowledgments

License

This repository is licensed under the MIT License. See the LICENSE file for details.

This project also includes modified MIT-licensed code from musicdiff. Original project lineage and attribution are preserved in the source headers under musicdiff/.

About

Open-source OMR benchmark for comparing Audiveris, HOMR, and OeMeR on the SMB dataset using OMR-NED.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages