BaoWentz / AdvancedEAST-PyTorch

将原本Keras版本的AdvancedEAST改写成PyTorch版,将数据集由.npy文件改成一个LMDB文件,加入Precision,Recall, F1 score方便训练以及调试,底层网络仍然用VGG16。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AdvancedEAST

AdvancedEAST-PyTorch is mainly inherited from AdvancedEAST, also we made some changes for better usage in PyTorch. If this project is helpful to you, welcome to star.

New features

  • writen in PyTorch, easy to read and run
  • change the dataset into LMDB format, reduce I/O overhead
  • added precision/recall/F1_score output which is helpful when training the model
  • just run train.py to automatically start training

Project files

  • config file: cfg.py, control parameters
  • pre-process data: preprocess.py , resize image
  • generate LMDB dataset: imgs2LMDB.py
  • [optional] label data: label.py, produce label info
  • define network: model_VGG.py
  • define loss function: losses.py
  • execute training: train.py
  • read LMDB dataset: dataset.py
  • predict: predict.py and nms.py
  • evaluate the model: utils.py

Network arch

  • AdvancedEast

AdvancedEast network arch

原理简介(含原理图)

后置处理(含原理图)

Setup

  • python 3.6.5
  • PyTorch-gpu 1.4.0
  • lmdb 0.98
  • numpy 1.19.0
  • tqdm 4.48.0
  • natsort 7.0.1
  • openCV 4.2.0
  • shapely 1.7.0
  • [optional] torchsummary

Training

  • tianchi ICPR dataset download 链接: https://pan.baidu.com/s/1NSyc-cHKV3IwDo6qojIrKA 密码: ye9y

  • prepare training data: make data root dir(train_1000), copy images to root dir, and copy txts to root dir, data format details could refer to ICPR MTWI 2018 挑战赛二:网络图像的文本检测

  • modify config params in cfg.py, see default values

  • [optional] python preprocess.py, resize image to 256X256, 384X384, 512X512, 640X640, 736X736, and train one by one could speed up training process(依次训练可以加速模型收敛)

  • [optional] python imgs2LMDB.py, generate LMDB sataset

  • python train.py, train entrance

  • python predict.py -p demo/001.png, to predict

  • pretrain model download(use for further training or test) 链接: 链接: https://pan.baidu.com/s/1q473YIt2b18RqpOT8rdY6g 提取码: nkit

License

The codes are released under the MIT License.

References

About

将原本Keras版本的AdvancedEAST改写成PyTorch版,将数据集由.npy文件改成一个LMDB文件,加入Precision,Recall, F1 score方便训练以及调试,底层网络仍然用VGG16。

License:MIT License


Languages

Language:Python 100.0%