• Stars
    star
    939
  • Rank 48,337 (Top 1.0 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pytorch re-implementation of Real-time Scene Text Detection with Differentiable Binarization

Real-time Scene Text Detection with Differentiable Binarization

note: some code is inherited from MhLiao/DB

中文解读

network

update

2020-06-07: 添加灰度图训练,训练灰度图时需要在配置里移除dataset.args.transforms.Normalize

Install Using Conda

conda env create -f environment.yml
git clone https://github.com/WenmuZhou/DBNet.pytorch.git
cd DBNet.pytorch/

or

Install Manually

conda create -n dbnet python=3.6
conda activate dbnet

conda install ipython pip

# python dependencies
pip install -r requirement.txt

# install PyTorch with cuda-10.1
# Note that you can change the cudatoolkit version to the version you want.
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

# clone repo
git clone https://github.com/WenmuZhou/DBNet.pytorch.git
cd DBNet.pytorch/

Requirements

  • pytorch 1.4+
  • torchvision 0.5+
  • gcc 4.9+

Download

TBD

Data Preparation

Training data: prepare a text train.txt in the following format, use '\t' as a separator

./datasets/train/img/001.jpg	./datasets/train/gt/001.txt

Validation data: prepare a text test.txt in the following format, use '\t' as a separator

./datasets/test/img/001.jpg	./datasets/test/gt/001.txt
  • Store images in the img folder
  • Store groundtruth in the gt folder

The groundtruth can be .txt files, with the following format:

x1, y1, x2, y2, x3, y3, x4, y4, annotation

Train

  1. config the dataset['train']['dataset'['data_path']',dataset['validate']['dataset'['data_path']in config/icdar2015_resnet18_fpn_DBhead_polyLR.yaml
  • . single gpu train
bash singlel_gpu_train.sh
  • . Multi-gpu training
bash multi_gpu_train.sh

Test

eval.py is used to test model on test dataset

  1. config model_path in eval.sh
  2. use following script to test
bash eval.sh

Predict

predict.py Can be used to inference on all images in a folder

  1. config model_path,input_folder,output_folder in predict.sh
  2. use following script to predict
bash predict.sh

You can change the model_path in the predict.sh file to your model location.

tips: if result is not good, you can change thre in predict.sh

The project is still under development.

Performance

ICDAR 2015

only train on ICDAR2015 dataset

Method image size (short size) learning rate Precision (%) Recall (%) F-measure (%) FPS
SynthText-Defrom-ResNet-18(paper) 736 0.007 86.8 78.4 82.3 48
ImageNet-resnet18-FPN-DBHead 736 1e-3 87.03 75.06 80.6 43
ImageNet-Defrom-Resnet18-FPN-DBHead 736 1e-3 88.61 73.84 80.56 36
ImageNet-resnet50-FPN-DBHead 736 1e-3 88.06 77.14 82.24 27
ImageNet-resnest50-FPN-DBHead 736 1e-3 88.18 76.27 81.78 27

examples

TBD

todo

  • mutil gpu training

reference

  1. https://arxiv.org/pdf/1911.08947.pdf
  2. https://github.com/WenmuZhou/PANet.pytorch
  3. https://github.com/MhLiao/DB

If this repository helps you,please star it. Thanks.

More Repositories

1

PytorchOCR

基于Pytorch的OCR工具库,支持常用的文字检测和识别算法
Python
1,345
star
2

OCR_DataSet

收集并整理有关OCR的数据集并统一标注格式,以便实验需要
Python
856
star
3

PSENet.pytorch

A pytorch re-implementation of PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network
C++
462
star
4

PAN.pytorch

A unofficial pytorch implementation of PAN(PSENet2): Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network
C++
413
star
5

TableGeneration

通过浏览器渲染生成表格图像
Python
185
star
6

flask_pytorch

using flask to run pytorch model
Python
48
star
7

crnn.gluon

A gluon re-implementation of Convolutional recurrent network in gluon
Python
21
star
8

reprod_log

Python
16
star
9

Segmentation-Free_OCR

recognize chinese and english without segmentation
Python
11
star
10

Torch_Quant_Demo

一个使用torch进行量化训练的demo
Python
9
star
11

ctpn.pytorch

Python
9
star
12

crypto

Python
7
star
13

dl_docker

用于深度学习的docker环境,cuda支持cuda10.1和cuda10.2,框架支持各种框架
Dockerfile
6
star
14

IcdarToCOCO

Python
5
star
15

gluon_mnist

learning gluon with mnist dataset
Python
5
star
16

mxnet_cifar10

Python
4
star
17

crnn.paddle

Python
4
star
18

leetcode

learning data struct with python
Jupyter Notebook
4
star
19

UCDIR.paddle

Python
4
star
20

TableMASTER_mmocr

Python
3
star
21

rust_python

use rust speed up python
Rust
3
star
22

pytorch_mnist

learning pytorch with mnist dataset
Python
3
star
23

WenmuZhou.github.io

个人博客
HTML
2
star
24

keras_mnist

learning keras with mnist
Python
2
star
25

gitment-comments

2
star
26

DABNet_Paddle

a paddle reproduce of DABNet
Python
1
star
27

simple_nlp

Python
1
star