Skip to content

TensorFlow2 and Keras implementation of EAST: An Efficient and Accurate Scene Text Detector

License

Notifications You must be signed in to change notification settings

solaris33/EAST-tf2

Repository files navigation

EAST-tf2: An Efficient and Accurate Scene Text Detector in TensorFlow2

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

Requirements

  • TensorFlow 2.0 or greater
  • Python 3

Expected directory structure

├── 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
│   ├── ...

Data

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.

Training

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.

Execution example

python3 train.py --training_data_path=./data/ICDAR2015/train_data/ --checkpoint_path=./east_resnet_50_rbox

Test

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.

Execution example

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/

Detection examples

image_1 image_2 image_3 image_4 image_5 image_6 image_7 image_8 image_9

Reference

About

TensorFlow2 and Keras implementation of EAST: An Efficient and Accurate Scene Text Detector

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published