├── preview.png
├── babel.config.js
├── src
├── shims-vue.d.ts
├── plugins
│ └── vuetify.ts
├── main.ts
├── shims-tsx.d.ts
├── utils.js
└── App.vue
├── public
├── fonts
│ ├── roboto-v19-latin-100.woff
│ ├── roboto-v19-latin-100.woff2
│ ├── roboto-v19-latin-regular.woff
│ └── roboto-v19-latin-regular.woff2
├── icons
│ ├── success.svg
│ ├── enqueued.svg
│ ├── error.svg
│ └── processing.svg
└── index.html
├── .gitignore
├── Dockerfile
├── tsconfig.json
├── LICENSE
├── README.md
├── package.json
└── backend
└── server.py
/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cemfi/measure-detector/HEAD/preview.png
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app',
4 | ],
5 | };
6 |
--------------------------------------------------------------------------------
/src/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue';
3 |
4 | export default Vue;
5 | }
6 |
--------------------------------------------------------------------------------
/public/fonts/roboto-v19-latin-100.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cemfi/measure-detector/HEAD/public/fonts/roboto-v19-latin-100.woff
--------------------------------------------------------------------------------
/public/fonts/roboto-v19-latin-100.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cemfi/measure-detector/HEAD/public/fonts/roboto-v19-latin-100.woff2
--------------------------------------------------------------------------------
/public/fonts/roboto-v19-latin-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cemfi/measure-detector/HEAD/public/fonts/roboto-v19-latin-regular.woff
--------------------------------------------------------------------------------
/public/fonts/roboto-v19-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cemfi/measure-detector/HEAD/public/fonts/roboto-v19-latin-regular.woff2
--------------------------------------------------------------------------------
/src/plugins/vuetify.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuetify from 'vuetify/lib';
3 | import 'vuetify/src/stylus/app.styl';
4 |
5 | Vue.use(Vuetify, {});
6 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import './plugins/vuetify';
3 | import App from './App.vue';
4 |
5 | Vue.config.productionTip = false;
6 |
7 | new Vue({
8 | render: h => h(App),
9 | }).$mount('#app');
10 |
--------------------------------------------------------------------------------
/src/shims-tsx.d.ts:
--------------------------------------------------------------------------------
1 | import Vue, { VNode } from 'vue';
2 |
3 | declare global {
4 | namespace JSX {
5 | // tslint:disable no-empty-interface
6 | interface Element extends VNode {}
7 | // tslint:disable no-empty-interface
8 | interface ElementClass extends Vue {}
9 | interface IntrinsicElements {
10 | [elem: string]: any;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | __pycache__
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
23 | # Project specific files
24 | backend/model.pb
25 | dist
--------------------------------------------------------------------------------
/public/icons/success.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/icons/enqueued.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/icons/error.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # build stage
2 | FROM node:lts-alpine as build-stage
3 | WORKDIR /usr/src/app
4 | COPY . .
5 | RUN npm install
6 | RUN npm run build
7 |
8 |
9 | # production stage
10 | FROM tensorflow/tensorflow:1.13.1-py3 as production-stage
11 | RUN apt-get update && apt-get install -y curl
12 | RUN pip3 install pillow hug gunicorn
13 | RUN mkdir -p /usr/src/app
14 |
15 | WORKDIR /usr/src/app
16 |
17 | RUN curl -L https://github.com/OMR-Research/MeasureDetector/releases/download/v1.0/2019-05-16_faster-rcnn-inception-resnet-v2.pb --output model.pb
18 |
19 | COPY backend ./
20 | COPY --from=build-stage /usr/src/app/dist ./
21 |
22 | EXPOSE 8000
23 |
24 | # ENTRYPOINT ["/bin/bash", "startup.sh"]
25 | CMD ["gunicorn", "--bind=0.0.0.0:8000", "--timeout=180", "--workers=2", "server:__hug_wsgi__"]
26 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "importHelpers": true,
8 | "moduleResolution": "node",
9 | "experimentalDecorators": true,
10 | "esModuleInterop": true,
11 | "allowSyntheticDefaultImports": true,
12 | "resolveJsonModule": true,
13 | "sourceMap": true,
14 | "baseUrl": ".",
15 | "types": [
16 | "webpack-env",
17 | "vuetify"
18 | ],
19 | "typeRoots": [
20 | "./@types",
21 | "./node_modules/@types"
22 | ],
23 | "paths": {
24 | "@/*": [
25 | "src/*"
26 | ]
27 | },
28 | "lib": [
29 | "esnext",
30 | "dom",
31 | "dom.iterable",
32 | "scripthost"
33 | ]
34 | },
35 | "include": [
36 | "src/**/*.ts",
37 | "src/**/*.tsx",
38 | "src/**/*.vue",
39 | "tests/**/*.ts",
40 | "tests/**/*.tsx",
41 | "@types/**/*.ts"
42 | ],
43 | "exclude": [
44 | "node_modules"
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 cemfi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Deep Optical Measure Detector
4 |
5 | This is a self contained package of the *Deep Optical Measure Detector*. It can be utilized to generate measure annotations in the MEI format (compatible to v3 & v4) for handwritten and typeset score images.
6 |
7 | ## Disclaimer
8 | This code was meant as a quick functional demonstration. It is **not** production ready or even documented! Handle with care.
9 |
10 | ## How to Run
11 | 1. Make sure to have [Docker](https://www.docker.com/) installed and running properly with at least 4 GB of RAM assigned to Docker.
12 |
13 | 2. Run the container in a terminal:
14 | ```bash
15 | docker run -p 8000:8000 -i --rm cemfi/measure-detector
16 | ```
17 |
18 | 3. Go to [http://localhost:8000](http://localhost:8000) and drop some images. Be patient, the detection is computationally pretty heavy.
19 |
20 | ## Acknowledgements
21 | The DNN model was trained by [Alexander Pacha](https://github.com/apacha/), see [this project](https://github.com/OMR-Research/MeasureDetector/).
22 | Thanks also to [Alexander Leemhuis](https://github.com/AlexL164) for meticulously annotating hundreds of score images for the dataset.
23 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Measures detected with Deep Optical Measure Detector
30 |(All files will be sorted alphanumerically before processing.)
23 |