This repository contains key scripts used to develop my Undergraduate Major Project, as well as the complete dataset used for object detection training for my final artefact.
The goal of this project is to produce an application capable of basic OMR (Optical Music Recognition). The application will be deployed on Android and should be able to detect, as a proof-of-concept, 8 different crotchet (quarter) notes denoting the notes C3 to C4 (in treble clef) in still and moving images.
Below is a list of Python scripts (written in Google Colab) that have been used in the project.
- create_pascal_voc.ipynb: A script written to produce Pascal-VOC style XML files for each image in the dataset from the CSV containing all bounding boxes for the dataset.
- dataset_to_tfrecord.py: Parses the XML file in this respository and creates corresponding testing and training TFRecord files for model training. Through research, the script places 10% of bounding boxes into the test file and the rest into the training file.
The dataset was originally put together for object detection, but may also be used for image classification if that's the intention. A CSV file is provided that contains all 3020 bounding boxes for the dataset. The CSV file does not have a header row, but the columns are as follows:
class_name, xmin, ymin, xmax, ymax, filename, width, height
Dataset class names can be used to classify images as note names or crotchet notes in general. If classifying as crotchet notes, the only available class is note
, and there are 3020 bounding boxes in total for this class.
If classifying as note names, there are 8 classes in total: LC, D, E, F, G, A, B, HC
, where LC
refers to the note C3 and HC
refers to the note C4. Across the images, these classes are somewhat more irregular and a breakdown of bounding boxes can be found below:
LC
: 123 bounding boxesD
: 170 bounding boxesE
: 224 bounding boxesF
: 265 bounding boxesG
: 789 bounding boxesA
: 636 bounding boxesB
: 509 bounding boxesHC
: 304 bounding boxes
There are a total of 18 images used for the dataset, with data augmentation performed on each one to produce 30 additional images for every image (resulting in 558 unique images). The 18 images are named as follows:
LC, D, E, F, G, A, B, HC, XA, XB, XC, XD, XE, XF, XG, XH, XI, XJ
The original image will be named, for example XD.jpeg
and augmentations produce files with a suffix. For example A_12.jpeg
or XF_30.jpeg
.
Images LC
through to HC
are of one note corresponding to the image's name and have one bounding box associated with it. The images XA
through to XJ
are images containing multiple different notes, and therefore have multiple bounding boxes per image.