Giter VIP home page Giter VIP logo

multi_digit_classification_attention's Introduction

Multi-character Prediction Using Attention

Setup

pip install -r requirements.txt

Codebase developed on Python-2.7.15

Multi-Digit classification - (SVHN dataset)

Preparing data

We need to prepare the raw SVHN dataset

  1. Go to the cloned multi_digit_classification_attention folder and run the following command:
cd SVHN
mkdir dataset
  1. Download the SVHN dataset and extract the train and test SVHN data into the dataset folder inside multi_digit_classification_attention folder.

  2. Select which type to data to curate and run the following command:

python gen_crop_dataset.py --dataset_type=<train/test>
  1. Select which type to data to generate attention mask and run the following command:
python gen_attn_truth.py --dataset_type=<train/test>

Training

  1. To train detection model run the following command:
python train.py
  1. To train classification model run the following command:
python train_classify_net.py

Inference

To test and visualize results run the following command:

jupyter notebook

and open and run:

> evaluate_and_viz.ipynb

End-2-End Learning for detection and classification

  1. To train full model for both detection and classification run the following command:
python train_end2end.py
  1. To test and visualize results run the following command:
jupyter notebook

and open and run:

> evaluate_and_viz_end2end.ipynb

CAPTCHA classification - (CAPTCHA dataset)

Preparing data

We need to generate raw CAPTCHA dataset

  1. Go to the cloned multi_digit_classification_attention folder and run the following command:
cd other/
mkdir dataset
  1. Generate dataset by running the following command:
python gen_captcha_dataset.py
  1. Move the generated dataset into CAPTCHA folder.

Training

  1. To train detection model run the following command:
python train.py
  1. To train classification model run the following command:
python train_classify_net.py

Inference

To test and visualize results run the following command:

jupyter notebook

and open and run:

> evaluate_and_viz.ipynb

End-2-End Learning for detection and classification

  1. To train full model for both detection and classification run the following command:
python train_end2end.py
  1. To test and visualize results run the following command:
jupyter notebook

and open and run:

> evaluate_and_viz_end2end.ipynb

Contribution guidelines

Any improvements would be appreciated, send a merge request if you would like to contribute.

multi_digit_classification_attention's People

Contributors

mfb999 avatar tonyjo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

toanduong5823

multi_digit_classification_attention's Issues

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.