SMB / README.md
JuanCarlosMartinezSevilla's picture
Update README.md
96332e8 verified
metadata
arxiv: arxiv.org/abs/2506.10488
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
configs:
  - config_name: default
    data_files:
      - split: test
        path: data/test-*
dataset_info:
  features:
    - name: image
      dtype: image
    - name: id
      dtype: string
    - name: original_width
      dtype: int64
    - name: original_height
      dtype: int64
    - name: regions
      list:
        - name: bbox
          struct:
            - name: x
              dtype: float64
            - name: 'y'
              dtype: float64
            - name: width
              dtype: float64
            - name: height
              dtype: float64
        - name: raw
          dtype: string
        - name: kern
          dtype: string
        - name: ekern
          dtype: string
    - name: page_texture
      dtype: string
    - name: page
      dtype: string
    - name: original_score
      dtype: string
  splits:
    - name: test
      num_bytes: 377907903
      num_examples: 685
  download_size: 366855603
  dataset_size: 377907903

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.

Use Cases:

  • Optical Music Recognition (OMR): system-level, full-page
  • Image Segmentation: music regions

Requesting access

As sometimes 🤗 is not emailing me when someone requests access. If you are interested, please reach out via email.

Dataset Details

Each page includes the corresponding **kern data for that specific page. Additionally, it provides detailed annotations for each region within the page.

Regions

  • Type: List of JSON objects
  • Description: Contains detailed information about regions on the page. Each JSON object includes:
    • bbox: Axis-aligned bounding box. All values are expressed as percentages (0–100) relative to the image dimensions.
      • x: Horizontal position of the left edge (percentage of image width).
      • y: Vertical position of the top edge (percentage of image height).
      • width: Width of the bounding box (percentage of image width).
      • height: Height of the bounding box (percentage of image height).
    • raw: The content extracted from the original dataset before any processing.
    • kern: A standardized version of the content ready for rendering.
    • ekern: A tokenized and standardized version of the content for enhanced processing.

SMB usage 📖

SMB is publicly available at HuggingFace.

To download from HuggingFace:

  1. Gain access to the dataset and get your HF access token from: 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 for details.
  3. Use the following code to load SMB and extract the regions:
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.
  """
  image = row["image"]
  draw = ImageDraw.Draw(image)

  for index, region in enumerate(row["regions"]):
      bbox = region["bbox"]
      x = bbox["x"] / 100 * row["original_width"]
      y = bbox["y"] / 100 * row["original_height"]
      w = bbox["width"] / 100 * row["original_width"]
      h = bbox["height"] / 100 * row["original_height"]

      draw.rectangle([x, y, x + w, y + h], outline="red", width=3)

      print(f"\nRegion {index}:\nkern: {region['kern']}")

  return image


if __name__ == "__main__":
  ds = load_dataset("PRAIG/SMB")
  ds = ds["test"]

  for row in ds:
      image = draw_bounding_boxes(row)
      image.show()
      input("Close the image window and press Enter to continue...")

Citation

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},
}