fturib / mdlg-engine

training and prediction engine for Mandlagore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mandlagore using dhSegment

@inproceedings{oliveiraseguinkaplan2018dhsegment, title={dhSegment: A generic deep-learning approach for document segmentation}, author={Ares Oliveira, Sofia and Seguin, Benoit and Kaplan, Frederic}, booktitle={Frontiers in Handwriting Recognition (ICFHR), 2018 16th International Conference on}, pages={7--12}, year={2018}, organization={IEEE} }

Mandlagore aims to extract the illuminations from the manuscripts

Demo

Have a try at the demo to train (optional) and apply dhSegment in page extraction using the demo.py script.

Build a Docker image

Use the command:

docker build --rm -f "Dockerfile" -t mdlg:latest "."

Run the mdlg-engine container using the mdlg-data volume

Ensure you have a docker server running:

docker run --rm -it -p 3000:3000/tcp -v mdlg-data:/data --name mdlg-engine-server mdlg:latest

Build the docker volume for the shared data with mdlg-engine

In fact, the volume is ceate with the first container using it.

docker volume rm mdlg-data
docker volume create mdlg-data

initialize the volume with demo images/models

Run an Ubuntu container that share the same volume mdlg-data

docker run -it -v mdlg-data:/data --name mdlg-data-linux ubuntu /bin/bash

once you have the prompt of this container, download and expand the files for demo:

apt-get update
apt-get install unzip -y
apt-get install wget -y
cd /data/demo && wget https://github.com/dhlab-epfl/dhSegment/releases/download/v0.2/pages.zip && unzip pages.zip
cd /data/demo && wget https://github.com/dhlab-epfl/dhSegment/releases/download/v0.2/model.zip && unzip model.zip

Keep open this terminal, to be able to share data with the mdlg-engine container that run predictions and trainings.

Call for execution of training on demo folder

# verify the server is up by calling the hello world
curl http://127.0.0.1:3000/hello

# run your own training/prediction for the demo process. You need to initialize properly the volume
# -> below, will run the demo program on the folder 'whatever' of the mdlg-data volume
curl http://127.0.0.1:3000/run/[whatever-path-in-sub-dirs]
# to run the given demo samples : curl http://127.0.0.1:3000/run/demo

# list files in the data folder
curl http://127.0.0.1:3000/files
curl http://127.0.0.1:3000/files/[whatever-path-in-sub-dirs]

# help for available commands
curl http://127.0.0.1:3000/help

About

training and prediction engine for Mandlagore

License:Apache License 2.0


Languages

Language:Python 84.5%Language:Dockerfile 8.5%Language:Smarty 7.0%