This repository contains a web service that finds and classifies symbols
of music notation. The service works .png
and .jpg
images that are scaled to a
staff interline of 10pt
.
The service is based on the microframework Flask
. The main route is /classify
, it lets you upload an image (POST to image).
The image will be scanned using a Deep Neural network and the bounding boxes of the detected symbols are returned in
a json
formatted string.
It is built to be used in conjunction with trained models following the DeepWatershed-Detection
architecture.
see: https://github.com/tuggeluk/DeepWatershedDetection
main.py
contains the flask app and calls the detection system located inclass_utils
.class_utils/
contains the code that loads a pretrained tensorflow model and performs the detection.demo/
contains a test/demo script for the service.important:
for this service to work you need to create a folder calledtrained_models
and place the correct pretrained models in said folder. (can be found at: https://drive.google.com/open?id=1Knm26FjS6YMrBVU009mRTc19ims1oj6R)Dockerfile
The dockerized version of all of this to reduce the amount of maintanence and administration necessary
We assume you're in the home directory.
- Build the docker image:
docker build dockerized_classifier/Detection_Service -t saty/detection
The -t
argument tags the image with the label saty/detection
- Create a self-restarting container from the image
docker create --restart unless-stopped --gpus all -p 5000:5000 --name detection_docker saty/detection
- Start and enable the service associated with running the docker container
sudo service detection-docker start
sudo systemctl enable detection-docker # To auto-start the service on reboot
- To check the status of the service
service detection-docker status
- To turn of the service
sudo service detection-docker stop
sudo systemctl disable detection-docker # Only if you want to prevent the service from restarting on reboot