This is a TensorFlow2 & Keras implementation of EAST: An Efficient and Accurate Scene Text Detector based on a Keras implementation made by kurapan and a TensorFlow1 implementation made by argman.
The features are summarized below:
- Only RBOX geometry is implemented
- Differences from the original paper
- Uses ResNet-50 instead of PVANet
- Uses dice loss function instead of balanced binary cross-entropy
- TensorFlow 2.0 or greater
- Python 3
├── EAST-tf2
│ ├── data
│ │ ├── ICDAR2015
│ │ │ ├── train_data
│ │ │ │ ├── gt_img_1.txt
│ │ │ │ ├── img_1.jpg
│ │ │ │ ├── ...
│ │ │ ├── test_data
│ │ │ │ ├── img_1.jpg
│ │ │ │ ├── ...
│ │ │ ├── test_data_output
│ ├── lanms
│ ├── train.py
│ ├── eval.py
│ ├── ...
You can use your own data, but the annotation files need to conform the ICDAR 2015 format.
ICDAR 2015 dataset can be downloaded from this site. You need the data from Task 4.1 Text Localization.
Alternatively, you can download a training dataset consisting of all training images from ICDAR 2015 and ICDAR 2013 datasets with annotation files in ICDAR 2015 format here (supported by kurapan).
The original datasets are distributed by the organizers of the Robust Reading Competition and are licensed under the CC BY 4.0 license.
You need to put all of your training images and their corresponding annotation files in one directory. The annotation files have to be named gt_IMAGENAME.txt
.
Training is started by running train.py
. It accepts several arguments including path to training data, and path where you want to save trained checkpoint models. You can see all of the arguments you can specify in the train.py
file.
python3 train.py --training_data_path=./data/ICDAR2015/train_data/ --checkpoint_path=./east_resnet_50_rbox
The images you want to detect have to be in one directory, whose path you have to pass as an argument. Detection is started by running eval.py
with arguments specifying gpu number to run, path to the images to be detected, the trained model, and a directory which you want to save the output in.
python3 eval.py --gpu_num=1 --test_data_path=./data/ICDAR2015/test_data --model_path=./east_resnet_50_rbox/ --output_dir=./data/ICDAR2015/test_data_output/