Python
Need help with moonlight?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
tensorflow

Description

Optical music recognition in TensorFlow

230 Stars 54 Forks Apache License 2.0 133 Commits 20 Opened issues

Services available

Need anything else?

Moonlight Optical Music Recognition (OMR) Build Status

An experimental optical music recognition engine.

Moonlight reads PNG image(s) containing sheet music and outputs MusicXML or a NoteSequence message. MusicXML is a standard sheet music interchange format, and

NoteSequence
is used by Magenta for training generative music models.

Moonlight is not an officially supported Google product.

Command-Line Usage

git clone https://github.com/tensorflow/moonlight
cd moonlight
# You may want to run this inside a virtualenv.
pip install -r requirements.txt
# Build the OMR command-line tool.
bazel build moonlight:omr
# Prints a Score message.
bazel-bin/moonlight/omr moonlight/testdata/IMSLP00747-000.png
# Scans several pages and prints a NoteSequence message.
bazel-bin/moonlight/omr --output_type=NoteSequence IMSLP00001-*.png
# Writes MusicXML to ~/mozart.xml.
bazel-bin/moonlight/omr --output_type=MusicXML --output=$HOME/mozart.xml \
    corpus/56/IMSLP56442-*.png

The

omr
CLI will print a
Score
message by default, or MusicXML or a
NoteSequence
message if specified.

Moonlight is intended to be run in bulk, and will not offer a full UI for correcting the score. The main entry point will be an Apache Beam pipeline that processes an entire corpus of images.

There is no release yet, and Moonlight is not ready for end users. To run interactively or import the module, you can use the sandbox directory.

Dependencies

  • Protobuf 3.6.1
  • Bazel 0.20.0. We encountered some errors using Bazel 0.21.0 to build Protobuf 3.6.1, which is the latest Protobuf release at the time of writing.
  • Python version supported by TensorFlow (Python 3.5-3.7)
  • Python dependencies specified in the requirements.

Resources

Forum

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.