pip install -r requirements.txt
Codebase developed on Python-2.7.15
We need to prepare the raw SVHN dataset
- Go to the cloned
multi_digit_classification_attention
folder and run the following command:
cd SVHN
mkdir dataset
-
Download the SVHN dataset and extract the train and test SVHN data into the
dataset
folder insidemulti_digit_classification_attention
folder. -
Select which type to data to curate and run the following command:
python gen_crop_dataset.py --dataset_type=<train/test>
- Select which type to data to generate attention mask and run the following command:
python gen_attn_truth.py --dataset_type=<train/test>
- To train detection model run the following command:
python train.py
- To train classification model run the following command:
python train_classify_net.py
To test and visualize results run the following command:
jupyter notebook
and open and run:
> evaluate_and_viz.ipynb
- To train full model for both detection and classification run the following command:
python train_end2end.py
- To test and visualize results run the following command:
jupyter notebook
and open and run:
> evaluate_and_viz_end2end.ipynb
We need to generate raw CAPTCHA dataset
- Go to the cloned
multi_digit_classification_attention
folder and run the following command:
cd other/
mkdir dataset
- Generate dataset by running the following command:
python gen_captcha_dataset.py
- Move the generated dataset into
CAPTCHA
folder.
- To train detection model run the following command:
python train.py
- To train classification model run the following command:
python train_classify_net.py
To test and visualize results run the following command:
jupyter notebook
and open and run:
> evaluate_and_viz.ipynb
- To train full model for both detection and classification run the following command:
python train_end2end.py
- To test and visualize results run the following command:
jupyter notebook
and open and run:
> evaluate_and_viz_end2end.ipynb
Any improvements would be appreciated, send a merge request if you would like to contribute.