This is a PyTorch re-implementation of EAST: An Efficient and Accurate Scene Text Detector (CVPR 2017).
The training results of the EAST model with 600 epochs on the ICDAR2015 dataset are summarized below:
Model | Loss | Recall | Precision | F-score |
---|---|---|---|---|
Original | CE | 72.75 | 80.46 | 76.41 |
Re-Implement | Dice | 81.27 | 80.61 | 80.93 |
To set up the project, run the following commands:
git clone https://github.com/yakhyo/east-pytorch.git
cd east-pytorch
pip install -r requirements.txt
To download weights of trained EAST model: Click to download
- Download the dataset here and place them as shown below:
- Task 4.1: Text Localization (2015 edition)
east-pytorch/
├── assets
├── evaluate
├── east
│ ├── models
│ └── utils
├── weights
└── data
├── ch4_test_gt
├── ch4_test_images
├── ch4_train_gt
└── ch4_train_images
Pre-trained backbone's weight can be downloaded from here(VGG model backbone trained on ImageNet) and
put it inside weights
folder and run the code below to train the model.
Usage:
usage: train.py [-h] [--cfg CFG] [--data-path DATA_PATH] [--pretrained PRETRAINED] [--checkpoint CHECKPOINT] [--save-dir SAVE_DIR]
[--batch-size BATCH_SIZE] [--learning-rate LEARNING_RATE] [--num-workers NUM_WORKERS] [--epochs EPOCHS]
Run below code to train:
python train.py
Usage of detect.py
:
usage: detect.py [-h] [--cfg CFG] [--weights WEIGHTS] [--input INPUT] [--output OUTPUT]
Run below code for model inference:
python detect.py --weights weights/model.pt --input [input_image] --output [output_file_name]
- The evaluation scripts are from ICDAR Offline evaluation and have been modified to run successfully with Python 3.8.
- Change the
evaluate/gt.zip
if you test on other datasets. - Modify the parameters in
east/tools/eval.py
and run:
If you find any issues within this code, feel free to create PR or issue.
The project is licensed under the MIT license.
- Some part of the code refers to https://github.com/SakuraRiven/EAST.