SMB / README.md
JuanCarlosMartinezSevilla's picture
Update README.md
0871185 verified
---
license: cc-by-nc-4.0
tags:
- music
- documents
- end-to-end
- full-page
- system-level
annotations_creators:
- manually expert-generated
pretty_name: Sheet Music Benchmark
size_categories:
- 1K<n<10K
task_categories:
- image-to-text
- image-segmentation
- text-retrieval
subtasks:
- document-retrieval
extra_gated_fields:
Affiliation: text
---
# ⚠️ Work in Progress! SMB: A Multi-Texture Sheet Music Recognition Benchmark ⚠️
## Overview
SMB (Sheet Music Benchmark) is a dataset of printed Common Western Modern Notation scores developed at the University of Alicante at the Pattern Recognition and Artificial Intelligence Group.
## Dataset Details
- **Image Format**: PNG
- **Encoding Formats**: RAW Humdrum **kern, **ekern (standarized **kern version)
- **Annotations**:
- *Segmentation:* Bounding boxes
- *Music encoding (system-level and full-page):* Humdrum **kern
- **Use Cases**:
- Optical Music Recognition (OMR): system-level, full-page
- Image Segmentation: music regions
## SMB usage 📖
SMB is publicly available at [HuggingFace](https://huggingface.co/datasets/PRAIG/SMB).
To download from HuggingFace:
1. Gain access to the dataset and get your HF access token from: [https://huggingface.co/settings/tokens](https://huggingface.co/settings/tokens).
2. Install dependencies and login HF:
- Install Python
- Run `pip install pillow datasets huggingface_hub[cli]`
- Login by `huggingface-cli login` and paste the HF access token. Check [here](https://huggingface.co/docs/huggingface_hub/guides/cli#huggingface-cli-login) for details.
3. Use the following code to load SMB and extract the regions:
```python
from datasets import load_dataset
from PIL import Image, ImageDraw
ds = load_dataset("PRAIG/SMB")
# First image of the train split
data = ds["train"][0]
image = data["image"]
# Create a drawing context
draw = ImageDraw.Draw(image)
for reg in data["regions"]:
value = reg["bbox"]
# Calculate positions and dimensions
box_x = value["x"] / 100 * data["original_width"]
box_y = value["y"] / 100 * data["original_height"]
box_width = value["width"] / 100 * data["original_width"]
box_height = value["height"] / 100 * data["original_height"]
# Calculate the corners of the box
top_left = (box_x, box_y)
top_right = (box_x + box_width, box_y)
bottom_left = (box_x, box_y + box_height)
bottom_right = (box_x + box_width, box_y + box_height)
# Draw the box
draw.rectangle([top_left, bottom_right], width=3)
# Save the image with boxes
image.save("image.png")
```
## Citation
If you use our work, please cite us:
```bibtex
@preprint{MartinezSevillaPRAIG24,
author = {Juan C. Martinez{-}Sevilla and
Noelia Luna{-}Barahona and
Joan Cerveto{-}Serrano and
Antonio Rios{-}Vila and
David Rizo and
Jorge Calvo{-}Zaragoza},
title = {A Multi{-}Texture Sheet Music Recognition Benchmark},
year = {2024}
}
```