GithubHelp home page GithubHelp logo

ravika / boundarynet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ihdia/boundarynet

0.0 1.0 0.0 18.17 MB

BoundaryNet - A Semi-Automatic Layout Annotation Tool

Home Page: https://ihdia.iiit.ac.in/BoundaryNet/

License: MIT License

Python 99.54% Shell 0.02% MATLAB 0.44%

boundarynet's Introduction

BoundaryNet

An Attentive Deep Network with Fast Marching Distance Maps for Semi-automatic Layout Annotation

To appear at ICDAR 2021 [ORAL PRESENTATION]

[ Paper ] [ Website ]
Figure : BoundaryNet architecture from different abstract levels: Mask-CNN, Anchor GCN.
We propose a novel resizing-free approach for high-precision semi-automatic layout annotation. The variable-sized user selected region of interest is first processed by an attention-guided skip network. The network optimization is guided via Fast Marching distance maps to obtain a good quality initial boundary estimate and an associated feature representation. These outputs are processed by a Residual Graph Convolution Network optimized using Hausdorff loss to obtain the final region boundary.

Dependencies and Installation

The BoundaryNet code is tested with

  • Python (3.5.x)
  • PyTorch (1.0.0)
  • CUDA (10.2)

Please install dependencies by

pip install -r requirements.txt

Usage

cd CODE

Initial Setup:

  • Download the Indiscapes dataset - [Dataset Link]
  • Place the
    • Dataset Images under data directory
    • Pretrained BNet Model weights in the checkpoints directory
    • JSON annotation data in datasets directory

Training

BoundaryNet

  1. MCNN:
bash Scripts/train_mcnn.sh
  1. Anchor GCN:
bash Scripts/train_agcn.sh
  1. End-to-end Fine Tuning:
bash Scripts/fine_tune.sh
  • For all of the above scripts, corresponding experiment files are present in experiments directory.
  • Any required parameter changes can be performed in these files.

Baselines

Refer to the Readme.md under the configs directory for modified baselines - CurveGCN, PolyRNN++ and DACN.

Inference

Test Set

To perform inference and get quantitative results on the test set.

bash Scripts/test.sh 

Check the qualitative results in visualizations/test_gcn_pred/ directory.

Custom Images

  • Add Document-Image path and Bounding Box coordinates in experiments/custom_args.json file.
  • Execute -
 python test_custom.py --exp experiments/custom_args.json

Check the corresponding instance-level boundary results at visualizations/test_custom_img/ directory.

Fine Tuning on Custom Dataset

  1. Add dataset images in data folder and Json annotations in datasets/data_splits/.

  2. Fine Tune MCNN

  • Modify parameters in experiments/encoder_experiment.json file
  • Freeze the Skip Attention backbone
bash train_mcnn.sh 

Check the corresponding instance-level boundary results at visualizations/test_encoder_pred/ directory.

  1. Train AGCN from scratch
  • From new MCNN model file in checkpoints
  • Modify the MCNN model checkpoint path in models/combined_model.py
bash train_agcn.sh

Check the corresponding instance-level boundary results at visualizations/test_gcn_pred/ directory.

Citation

If you use BoundaryNet, please use the following BibTeX entry.

@inproceedings{trivedi2021boundarynet,
    title = {BoundaryNet: An Attentive Deep Network with Fast Marching Distance Maps for Semi-automatic Layout Annotation},
    author = {Trivedi, Abhishek and Sarvadevabhatla, Ravi Kiran},
    booktitle = {International Conference on Document Analysis Recognition, {ICDAR} 2021},
    year = {2021},
}

Contact

For any queries, please contact Dr. Ravi Kiran Sarvadevabhatla

License

This project is open sourced under MIT License.

boundarynet's People

Contributors

abhishek-trivedi avatar cvitatma avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.