Giter Site home page Giter Site logo

aashrafh / mozart Goto Github PK

View Code? Open in Web Editor NEW
569.0 17.0 82.0 358.16 MB

An optical music recognition (OMR) system. Converts sheet music to a machine-readable version.

License: Apache License 2.0

Python 1.39% Jupyter Notebook 98.61%
omr optical-music-recognition music music-sheet music-sheet-reading reader skimage opencv mozart optical-character-recognition

mozart's Introduction

Mozart logo

๐ŸŽถ Convert sheet music to a machine-readable version.


๐Ÿ“ Table of Contents

๐Ÿง About

The aim of this project is to develop a sheet music reader. This is called Optical Music Recognition (OMR). Its objective is to convert sheet music to a machine-readable version. We take a simplified version where we convert an image of sheet music to a textual representation that can be further processed to produce midi files or audio files like wav or mp3.

About

๐Ÿ’ป Methodology

1. Noise Filtering and Binarization

Binary Image

2. Segmentation

Segment 1

Segment 2

Segment 3

3. Staff Line Detection and Removal

No Staff Image 1

No Staff Image 2

No Staff Image 3

4. Construct The New Staff Lines

New Staff Image 1

New Staff Image 2

New Staff Image 3

5. Symbol Detection and Recognition

Result 1

Result 2

Result 3

๐Ÿ Install

  1. You can use the attached notebook for quick testing and visualization.
  2. You can setup an environment on your local machine to run the project:
    1. Install Conda
    2. conda env create -f requirements.yml
    3. conda activate mozart
    4. python3 main.py <input directory path> <output directory path>

You can find the dataset on Google Drive.

Please check the following issue for another requirements.yml file.

โ›๏ธ Built Using

mozart's People

Contributors

aashrafh avatar aashrafh22 avatar ahmedmgz7 avatar ahmedsherif304 avatar djemeljanovs avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mozart's Issues

When trying to use get error

When I am trying to use this after following all the steps, I get the error below

Traceback (most recent call last): File "main.py", line 1, in <module> from commonfunctions import * ModuleNotFoundError: No module named 'commonfunctions'

txt to lilypond notation

apologies if this is a stupid question as I am just starting with computer music notation, but is the txt output of your OMR compatible with lilypond?
Thanks

Mozart in a container?

In the spirit of #13 ("could you release a binary") I suggest releasing a version in a Docker container to reduce the pain of installation.

Import Error, 'Symbol not Found'

Hello @aashrafh ! thank you for your repo.
I'm successfully done on install step3. "conda activate mozart"
but when I get through step4, It gives me an error 'Symbol not Found'
and also I wonder that do I need to run main.py file on Mozart-main/src/ directory? I'm not sure about this step.
my environment is macOS, BIg Sur.

this is the error I got.
Traceback (most recent call last): File "main.py", line 2, in <module> from pre_processing import * File "/Users/parkhyunwoo/opt/anaconda3/envs/mozart/Mozart-main/src/pre_processing.py", line 4, in <module> import cv2 ImportError: dlopen(/Users/parkhyunwoo/opt/anaconda3/envs/mozart/lib/python3.7/site-packages/cv2.cpython-37m-darwin.so, 2): Symbol not found: _mp_get_memory_functions Referenced from: /Users/parkhyunwoo/opt/anaconda3/envs/mozart/lib/libgnutls.30.dylib Expected in: /Users/parkhyunwoo/opt/anaconda3/envs/mozart/lib/libhogweed.4.dylib in /Users/parkhyunwoo/opt/anaconda3/envs/mozart/lib/libgnutls.30.dylib

generate audio file

Hello, good to see this repo! May I ask do you have a plan to incorperate a tool to generate audio file from text representation?

Error for creating conda env

I got the following error:

conda env create -f requirements.yml
Collecting package metadata (repodata.json): done
Solving environment: failed

I tried on two different MacBook Pro, and got the same errors.

It will be great to provide some hints how to solve this problem.

Thanks!

Error while running main script

I get the following error while running the main script as

python src/main.py testcases output
Traceback (most recent call last):
  File "src/main.py", line 255, in <module>
    main(args.inputfolder, args.outputfolder)
  File "src/main.py", line 243, in main
    imgs_with_staff, imgs_spacing, imgs_rows)
  File "src/main.py", line 120, in recognize
    labels = predict(saved_img)
  File "/home/napulen/Mozart/src/fit.py", line 11, in predict
    train('NN', 'hog', 'nn_trained_model_hog')
  File "/home/napulen/Mozart/src/train.py", line 118, in train
    model, accuracy = run_experiment(model_name, feature_name, dir_names)
  File "/home/napulen/Mozart/src/train.py", line 104, in run_experiment
    features, labels, test_size=0.2, random_state=random_seed)
  File "/home/napulen/miniconda3/envs/mozart2/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 2131, in train_test_split
    default_test_size=0.25)
  File "/home/napulen/miniconda3/envs/mozart2/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 1814, in _validate_shuffle_split
    train_size)
ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.

Any idea what's going on?

Train dataset?

Thank you very much for this wonderful repo.
I am doing research works on OMR, and tried the command:
python3 main.py <input directory path> <output directory path>
it works fine. But when I executed this:
python3 train.py
got error with:
ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.
So I found the dataset directory missed in the project:
dataset_path = 'train_data/data'
Can you commit it again?

Thanks!

Training Dataset

Hi I was hopping you could help locate the training data set referred to in src/train.py on line 13

dataset_path = 'train_data/data'
target_img_size = (100, 100)
sample_count = 50

I came here from this tutorial but was unable find any links. This is an outstanding project and I would love to see how I can tweak the model myself. Thanks.

Colab notebook ?

Hi , was just wondering if there is an associated colab notebook available to quickly try out examples ?

Evaluation of Mozart

Very nice work, but I have a question in my mind. How should we evaluate the generated txt outputs, that is, with which method can we benchmark the OMR system?

Binaries

Is it possible for you to provide a binary release of this project? Because I'm dumb as hell when it comes to these types of installs.

Broken imports from fit.py

from fit import match, remove_repeated_matches, predict

fit.py has no methods match, remove_repeated_matches declared

Collecting package metadata terminated.

Hi, when I run conda env create -f requirements.yml I got this:

Collecting package metadata (repodata.json): / Terminated

Here's my conda version:

$ conda -V
conda 23.5.0

Could anyone please give me any advice?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.