This system takes in an input document image and outputs a image with region labels overlaid on top of the image. It also generates a json which can then be loaded as a project in the annotator tool for further refinement. We also provide instructions for training the model.
python3 -m pip install -r requirements.txt
- Download the pretrained model from this link
- Place the
pretrained_model_indiscapes.h5
file in the root folder - Start the GUI application (
main/doc/app.py
)
python3 app.py
If you get an error "No module Named skimage". It can be fixed by installing scikit-image. Enter- pip install scikit-image
in your Terminal or Command Prompt.
- Upload the image and click on submit. To generate the json, click on
Create json
. This will generate a json which can be loaded in the annotator.
- This also outputs the final result (Labelled regions overlaid on top of the original image) at
Instance-segmentation/main/doc/static/images/2.jpg
- Download the Indiscapes dataset from this link and
mask_rcnn_coco.h5
from this link - Place the folders
bhoomi_images
andPIH_images
and the filemask_rcnn_coco.h5
inside the root folder (Instance-segmentation
) - To start training :
- Train a new model starting from pre-trained COCO weights
python3 train.py train --dataset=/path/to/doc/dataset --weights=coco
- Resume training a model that you had trained earlier
python3 train.py train --dataset=/path/to/doc/dataset --weights=last