Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.82 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.82 KB

Region-segmentation

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.

Install prerequisites

python3 -m pip install -r requirements.txt

To run Inference on your own image

  1. Download the pretrained model from this link
  2. Place the pretrained_model_indiscapes.h5 file in the root folder
  3. 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.

  1. 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.

app

  1. This also outputs the final result (Labelled regions overlaid on top of the original image) at Instance-segmentation/main/doc/static/images/2.jpg

Results

To train the model

  1. Download the Indiscapes dataset from this link and mask_rcnn_coco.h5 from this link
  2. Place the folders bhoomi_images and PIH_images and the file mask_rcnn_coco.h5 inside the root folder (Instance-segmentation)
  3. 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