Skip to content

IndexError: list index out of range (sfn_label = sfns_cands[0].label) #68

Open
@samuelbradshaw

Description

Describe the bug
I'm trying out oemer for the first time today to see how well it handles sheet music from old hymnals. However, I'm getting an error: IndexError: list index out of range – see the traceback below.

Input Image

9693e3d8-4e69-41bd-9df4-148698c84404
(image source)

Full Traceback

% oemer /Users/username/Desktop/9693e3d8-4e69-41bd-9df4-148698c84404.jpeg
2024-12-29 22:11:06 Extracting staffline and symbols
2024-12-29 22:11:06.284547 [W:onnxruntime:, coreml_execution_provider.cc:104 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 86 number of nodes in the graph: 1577 number of nodes supported by CoreML: 102
1591 2310
Context leak detected, msgtracer returned -1
Context leak detected, msgtracer returned -1
2024-12-29 22:12:06 Extracting layers of different symbols
2024-12-29 22:12:06.056353 [W:onnxruntime:, coreml_execution_provider.cc:104 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 94 number of nodes in the graph: 1619 number of nodes supported by CoreML: 107
1591 2310
Context leak detected, msgtracer returned -1
Context leak detected, msgtracer returned -1
2024-12-29 22:13:57 Dewarping
2024-12-29 22:14:02 Extracting stafflines
/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
  ret = ret.dtype.type(ret / rcount)
0 198 1
199 397 398 596 10
597 795 10
796 994 10
995 1193 10
1194 1590 10
2024-12-29 22:14:03 Extracting noteheads
2024-12-29 22:14:03 Analyzing notehead bboxes
2024-12-29 22:14:04 Instanitiating notes
2024-12-29 22:14:07 Grouping noteheads
2024-12-29 22:14:13 Extracting symbols
/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/sklearn/base.py:376: InconsistentVersionWarning: Trying to unpickle estimator SVC from version 1.2.0 when using version 1.5.1. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
  warnings.warn(
  
… [NOTE: The above warning is repeated 67 times – not sure if it's relevant. I removed the repetition for easier reading]

2024-12-29 22:14:14 Extracting rhythm types
2024-12-29 22:14:48 Building MusicXML document
Traceback (most recent call last):
  File "/Users/username/.pyenv/versions/3.11.8/bin/oemer", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/ete.py", line 287, in main
    mxl_path = extract(args)
               ^^^^^^^^^^^^^
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/ete.py", line 215, in extract
    builder.build()
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/build_system.py", line 574, in build
    self.gen_measures(group_container)
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/build_system.py", line 680, in gen_measures
    mm = gen_measure(buffer, grp, num, at_beginning, double_barline)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/build_system.py", line 740, in gen_measure
    mm.get_key()  # Initialize internal states.
    ^^^^^^^^^^^^
  File "/Users/username/.pyenv/versions/3.11.8/lib/python3.11/site-packages/oemer/build_system.py", line 198, in get_key
    sfn_label = sfns_cands[0].label
                ~~~~~~~~~~^^^
IndexError: list index out of range

Command You Execute

oemer /Users/username/Desktop/9693e3d8-4e69-41bd-9df4-148698c84404.jpeg

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions