pytorch, ctpn ,text detection ,ocr,文本检测
my blog about CTPN blog
Ctpn works better for horizontal text, but worse for oblique and curved text.If you are interested in text detection and model compression, you can pay attention to the two projects I will do next, psenet and DBNet
nms and bbox utils are written in cython, you have to build the library first.
cd utils/bbox
sh make.sh
It will generate a nms.so and a bbox.so in current folder.
python3 inference.py
base_model | Model_size(M) | model_file |
---|---|---|
vgg16_bn | 67.7 | baiduyun(extract code: 5pgy) |
resnet50 | 137 | baiduyun(extract code: 5pgy) |
shufflenet_v2_x1_0 | 25.4 | baiduyun (extract code: 5pgy) |
mobilenet_v3_large | 16.9 | baiduyun (extract code: 5pgy) |
mobilenet_v3_small | 13.5 | baiduyun (extract code: 5pgy) |
follow icdar15 dataset format, x1,y1,x2,y2,x3,y3,x4,y4,label
image
│ 1.jpg
│ 2.jpg
│ ...
label
│ 1.txt
│ 2.txt
| ...
Simplely run
python3 train.py --base_model vgg16_bn --batch_size 4 --size_list [1048]
rescall | prediction | hmean |
---|---|---|
0.4058 | 0.6117 | 0.4879 |