BreezeWhite / oemer

End-to-end Optical Music Recognition (OMR) system. Transcribe phone-taken music sheet image into MusicXML, which can be edited and converted to MIDI.
https://breezewhite.github.io/oemer/
MIT License
386 stars 46 forks source link

Staffline extraction gives TypeError iteration over a 0-d array #13

Closed howff closed 2 years ago

howff commented 2 years ago

Program failed with error:

2022-09-22 16:52:22 Extracting stafflines
/home/arb/src/omr/venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/home/arb/src/omr/venv/lib/python3.8/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
1947 1982 1983 2018 2019 2054 2055 2090 2091 2126 2127 2162 1
2163 2198 2199 2236 Traceback (most recent call last):
  File "/src/omr/venv/bin/oemer", line 8, in <module>
    sys.exit(main())
  File "/src/omr/venv/lib/python3.8/site-packages/oemer/ete.py", line 267, in main
    mxl_path = extract(args)
  File "/src/omr/venv/lib/python3.8/site-packages/oemer/ete.py", line 158, in extract
    staffs, zones = staff_extract()
  File "/src/omr/venv/lib/python3.8/site-packages/oemer/staffline_extraction.py", line 335, in extract
    num_track = further_infer_track_nums(all_staffs, min_degree=barline_min_degree)
  File "/src/omr/venv/lib/python3.8/site-packages/oemer/staffline_extraction.py", line 607, in further_infer_track_nums
    lines = filter_lines(lines, staffs, min_degree=min_degree)
  File "/src/omr/venv/lib/python3.8/site-packages/oemer/staffline_extraction.py", line 645, in filter_lines
    for st in staffs.reshape(-1, 1).squeeze():
TypeError: iteration over a 0-d array
BreezeWhite commented 2 years ago

Same reply as here. One probable solution is to add --without-deskew to the command.

BreezeWhite commented 2 years ago

If you still have the problem using oemer, please file a new issue and follow the template format.