Skip to content

Proper grandstaff detection #62

@liebharc

Description

@liebharc

homr processes sheet music in four stages:

  1. detect individual staffs
  2. group staffs connected by a brace
  3. merge paired staffs into grandstaffs
  4. run symbol recognition on the resulting staff images

Step 3 is weak. Piano notation uses a grandstaff (upper + lower staff). Running recognition on each staff separately reduces accuracy because the model loses vertical context across both staffs.

The task: implement a reliable way to decide whether two adjacent staffs form a grandstaff or are independent voices.

Current state: grandstaff creation is done blindly.

Possible direction:

  • Use brace detections from the segmentation model.
  • Match brace bounding boxes to staff vertical ranges.
  • Derive stable pairing rules from brace-staff alignment instead of fixed ordering.

Relevant code:

  • _create_grandstaffs in brace_dot_detection.py
  • create_grandstaffs in model.py

This issue has an example: #60

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions