east-pytorch

EAST: An Efficient and Accurate Scene Text Detector

Downloads GitHub Repository

This is a PyTorch re-implementation of EAST: An Efficient and Accurate Scene Text Detector (CVPR 2017).

Table of Contents

Project Description

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

Installation

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

Dataset:

east-pytorch/
├── assets
├── evaluate
├── east
│   ├── models
│   └── utils
├── weights
└── data
    ├── ch4_test_gt
    ├── ch4_test_images
    ├── ch4_train_gt
    └── ch4_train_images

Usage

Train:

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

Inference:

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]

Model Architecture

EAST Detector

Evaluation and Inference:

  1. The evaluation scripts are from ICDAR Offline evaluation and have been modified to run successfully with Python 3.8.
  2. Change the evaluate/gt.zip if you test on other datasets.
  3. Modify the parameters in east/tools/eval.py and run:

Contributing

If you find any issues within this code, feel free to create PR or issue.

License

The project is licensed under the MIT license.

Reference

  1. Some part of the code refers to https://github.com/SakuraRiven/EAST.