lct1997 / BasicSTISR

BasicSTISR (Basic Scene Text Image Super Resolution) 是一个基于 PyTorch 的开源场景文本图像超分辨率工具箱.
Apache License 2.0
7 stars 0 forks source link

BasicSTISR

BasicSTISR (Basic Scene Text Image Super Resolution) 是一个基于 PyTorch 的开源场景文本图像超分辨率工具箱.

  1. It has detailed training logging.
  2. It's more concise than the previous code.
  3. It's simpler and easy to use.

Prepare Datasets

In this work, we use STISR datasets TextZoom and four STR benchmarks, i.e., ICDAR2015, CUTE80, SVT and SVTP for model comparison.

All the datasets are lmdb format. One can download these datasets from the this link.

./datasets/TextZoom/
    --test
    --train1
    --train2

NOTE: Please do not forget to accustom your own dataset path in config/super_resolution.yaml , such as the parameter train_data_dir and val_data_dir.

Prepare Pretrain Text Recognizers

Following previous STISR works, we also use CRNN, MORAN and ASTER as the downstream text recognizer.

.pretrained/
    --aster.pth.tar
    --crnn.pth
    --moran.pth

Text Gestalt(TG)

  1. Download the pre-trained weights and logs at BaiduYunDisk with password: vqg7

  2. Download the pretrain_transformer_stroke_decomposition.pth at BaiduYunDisk with password: mteb

    ./dataset/
    --charset_36.txt 
    --confuse.pkl
    --english_decomposition.txt
    --pretrain_transformer_stroke_decomposition.pth

How to Run?

We have set some default hype-parameters in the config/super_resolution.yaml and main.py, so you can directly implement training and testing after you modify the path of datasets and pre-trained model.

Training

sh train.sh

Testing

sh test.sh

Acknowledgement

The code of this work is based on TBSRN, TG, TATT, C3-STISR, and LEMMA. Thanks for your contributions.