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

Trying to use this software, I'm failing please help #5

Closed MacShrike closed 2 years ago

MacShrike commented 2 years ago

Dear WhiteBreeze,

I'm struggling to get this to work. First of, I never used python before but I think I managed to get it all up and running. However I keep getting this out of memory error. Simple question; do I need more memory =)) This is the end result: C:\Users\macsh\AppData\Local\Programs\Thonny\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:56: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'CPUExecutionProvider' "Available providers: '{}'".format(name, ", ".join(available_provider_names))) Traceback (most recent call last): File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\macsh\AppData\Local\Programs\Thonny\Scripts\oemer.exe__main__.py", line 7, in File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\site-packages\oemer\ete.py", line 261, in main mxl_path = extract(args) File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\site-packages\oemer\ete.py", line 118, in extract staff, symbols, stems_rests, notehead, clefs_keys = generate_pred(str(img_path)) File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\site-packages\oemer\ete.py", line 47, in generate_pred staff_symbolsmap, = inference(os.path.join(MODULE_PATH, "checkpoints/unet_big"), img_path) File "C:\Users\macsh\AppData\Local\Programs\Thonny\lib\site-packages\oemer\inference.py", line 53, in inference image = cv2.imread(img_path) cv2.error: OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-1gnnrwcf\opencv\modules\core\src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 673442055 bytes in function 'cv::OutOfMemoryError'

BreezeWhite commented 2 years ago

You probably need to resize your image to a smaller size, since the error happened while reading the image. Your image has ~640 MB.

MacShrike commented 2 years ago

Dear Breeze.. WhiteMaster,

Yah, just checked. The image is about 640 Mb. Doesn't seem that large, in todays day and age. It was a standard PDF image pull. What would you recommend as optimal size for the input image size? Highest regards, Mac

BreezeWhite commented 2 years ago

It's better to have image <10 MB. Also, oemer doesn't accept PDF file, so you need to transform it into whatever standard image format.