This is a CAFFE re-implementation of EAST: An Efficient and Accurate Scene Text Detector.
thanks to these project:
- https://github.com/argman/EAST
- https://github.com/YukangWang/TextField
- https://github.com/chuanqi305/MobileNet-SSD
The features are summarized blow:
- OpenCV_DNN/ CAFFE inference demo.
- Only RBOX part is implemented.
- Use MobileNet_v3 as backbone.
- NCNN/ MNN deploy support, Use NCNN int8 quantization, the model size can be 2M or less. Very suitable for deploy on Mobile devices.
-
Any version of caffe version > 1.0 should be ok. (suggest use the https://github.com/weiliu89/caffe/tree/ssd)
-
If the DiceCoefLoss Layer do not support, please recompile caffe with the Dice Coefficient Loss Layer (https://github.com/HolmesShuan/A-Variation-of-Dice-coefficient-Loss-Caffe-Layer) or use python version 'DiceCoefLossLayer' (The comment part in train.prototxt) as subsititution.
-
The ReLU6 layer implementation can be found in https://github.com/chuanqi305/ssd
-
Build geo_map_cython_lib ( Accelerate preprocessing in distance calculation)
cd geo_map_cython_lib sh build_ext.sh
- Models trained on ICDAR 2013 (training set)
https://pan.baidu.com/s/1_daEvvt7ur3FdXVxVKSF9A ( extract code:krdu )
- Models trained on ICDAR 2015 (training set)
https://pan.baidu.com/s/1DLTJDiRIqihE6ad5uiHEFA ( extract code:pn0w )
- Models trained on fake_idcard with single character annotation
https://pan.baidu.com/s/1KpG7xFPChyJMftAGR2SdYw ( extract code:m70q )
If you want to train the model, you should provide the dataset path, in the dataset path, the images and the gt text files should be separated into two filefolders as shown as below:
train_images\ train_gts\ test_images\ test_gts\
and the gts content format is
x1,y1,x2,y2,x3,y3,x4,y4,recog_results
and run
python train.py --gpu 0 --initmodel my_model.caffemodel
If you have more than one gpu, you can pass gpu ids to gpu_list(like --gpu 0,1,2,3)
Put the pretrained model into snapshot directory.
Then run
python demo.py