Optical Music Recognition Datasets
Collection
All the available datasets for OMR.
β’
4 items
β’
Updated
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.
Each page includes the corresponding **kern data for that specific page. Additionally, it provides detailed annotations for each region within the page.
SMB is publicly available at HuggingFace.
To download from HuggingFace:
pip install pillow datasets huggingface_hub[cli]huggingface-cli login and paste the HF access token. Check here for details.import math
from datasets import load_dataset
from PIL import ImageDraw
def draw_bounding_boxes(row):
"""
Draws bounding boxes on an image based on region data provided in the row.
Args:
row (dict): A row from the dataset.
Returns:
PIL.Image: An image with bounding boxes drawn.
"""
# Load the image
image = row["image"]
# Create a drawing context
draw = ImageDraw.Draw(image)
# Iterate through regions in the row
for index, region in enumerate(row["regions"]):
# Extract bounding box data
bbox = region["bbox"]
box_x = bbox["x"] / 100 * row["original_width"]
box_y = bbox["y"] / 100 * row["original_height"]
box_width = bbox["width"] / 100 * row["original_width"]
box_height = bbox["height"] / 100 * row["original_height"]
rotation = bbox["rotation"]
# Convert rotation to radians
rotation_rad = math.radians(rotation)
# Calculate the corners relative to the top-left corner (anchor point)
corners = [
(0, 0), # Top-left
(box_width, 0), # Top-right
(box_width, box_height), # Bottom-right
(0, box_height), # Bottom-left
]
# Apply rotation around the top-left corner
rotated_corners = []
for x, y in corners:
rotated_x = box_x + x * math.cos(rotation_rad) - y * math.sin(rotation_rad)
rotated_y = box_y + x * math.sin(rotation_rad) + y * math.cos(rotation_rad)
rotated_corners.append((rotated_x, rotated_y))
# Draw the rotated rectangle
draw.polygon(rotated_corners, outline="red", width=3)
# Show region data
print(f"\nRegion {index}:"
f"\nRotation (degrees): {rotation}"
f"\nkern: {region['kern']}")
return image
if __name__ == "__main__":
# Load dataset from Hugging Face
ds = load_dataset("PRAIG/SMB")
# Select a subset of the dataset
ds = ds["test"]
# Iterate through rows in the dataset
for row in ds:
# Draw bounding boxes on the image
image = draw_bounding_boxes(row)
# Show the image and wait for user to close it
image.show()
input("Close the image window and press Enter to continue...")
If you use our work, please cite us (there is an arXiv version, but this one is the official):
@inproceedings{juan_c_martinez_sevilla_2025_17811446,
author = {Juan C. Martinez-Sevilla and
Joan Cerveto-Serrano and
Noelia Luna-Barahona and
Greg Chapman and
Craig Sapp and
David Rizo and
Jorge Calvo-Zaragoza},
title = {Sheet Music Benchmark: Standardized Optical Music
Recognition Evaluation
},
booktitle = {Proceedings of the 26th International Society for
Music Information Retrieval Conference
},
year = 2025,
pages = {618-625},
publisher = {ISMIR},
month = sep,
venue = {Daejeon, South Korea and Online},
doi = {10.5281/zenodo.17811446},
url = {https://doi.org/10.5281/zenodo.17811446},
}