All Projects → xmfbit → Warpctc Caffe

xmfbit / Warpctc Caffe

Licence: other
Combine Baidu Research warpctc with Caffe

Labels

Projects that are alternatives of or similar to Warpctc Caffe

Nhyai
AI智能审查,支持色情识别、暴恐识别、语言识别、敏感文字检测和视频检测等功能,以及各种OCR识别能力,如身份证、驾照、行驶证、营业执照、银行卡、手写体、车牌和名片识别等功能,可以访问网站体验功能。
Stars: ✭ 60 (-35.48%)
Mutual labels:  caffe
Dispnet Flownet Docker
Dockerfile and runscripts for DispNet and FlowNet1 (estimation of disparity and optical flow)
Stars: ✭ 78 (-16.13%)
Mutual labels:  caffe
Onnx Chainer
Add-on package for ONNX format support in Chainer
Stars: ✭ 83 (-10.75%)
Mutual labels:  caffe
Audio Pretrained Model
A collection of Audio and Speech pre-trained models.
Stars: ✭ 61 (-34.41%)
Mutual labels:  caffe
Mtcnn
face detection and alignment with mtcnn
Stars: ✭ 66 (-29.03%)
Mutual labels:  caffe
Mobilenet Caffe
Caffe Implementation of Google's MobileNets (v1 and v2)
Stars: ✭ 1,217 (+1208.6%)
Mutual labels:  caffe
Haddoc2
Caffe to VHDL
Stars: ✭ 57 (-38.71%)
Mutual labels:  caffe
Core50
CORe50: a new Dataset and Benchmark for Continual Learning
Stars: ✭ 91 (-2.15%)
Mutual labels:  caffe
Caffe2pytorch Tsn
Transform the caffe model to pytorch model for Temporal Segment Network
Stars: ✭ 69 (-25.81%)
Mutual labels:  caffe
Dlcv for beginners
《深度学习与计算机视觉》配套代码
Stars: ✭ 1,244 (+1237.63%)
Mutual labels:  caffe
Ssd Models
把极速检测器的门槛给我打下来make lightweight caffe-ssd great again
Stars: ✭ 62 (-33.33%)
Mutual labels:  caffe
Pwc Net
PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume, CVPR 2018 (Oral)
Stars: ✭ 1,142 (+1127.96%)
Mutual labels:  caffe
Tensorrtwrapper
TensorRT Net Wrapper
Stars: ✭ 81 (-12.9%)
Mutual labels:  caffe
Head Pose Estimator.caffe
Head Pose Estimator on Caffe
Stars: ✭ 60 (-35.48%)
Mutual labels:  caffe
Mobilenet Ssd
MobileNet-SSD(MobileNetSSD) + Neural Compute Stick(NCS) Faster than YoloV2 + Explosion speed by RaspberryPi · Multiple moving object detection with high accuracy.
Stars: ✭ 84 (-9.68%)
Mutual labels:  caffe
Feathercnn
FeatherCNN is a high performance inference engine for convolutional neural networks.
Stars: ✭ 1,106 (+1089.25%)
Mutual labels:  caffe
Caffe Tools
Some tools and examples for pyCaffe including LMDB I/O, custom Python layers and monitoring training error and loss.
Stars: ✭ 78 (-16.13%)
Mutual labels:  caffe
Mobilenet V2 Caffe
MobileNet-v2 experimental network description for caffe
Stars: ✭ 93 (+0%)
Mutual labels:  caffe
Caffe Model
Caffe models (including classification, detection and segmentation) and deploy files for famouse networks
Stars: ✭ 1,258 (+1252.69%)
Mutual labels:  caffe
Vehicle Retrieval Kcnns
vehicle image retrieval using k CNNs ensemble method
Stars: ✭ 81 (-12.9%)
Mutual labels:  caffe

Caffe-With-Warpctc

CTC Loss is used in sequence learning. The repo merges WarpCTC which is implmented and maintained by Baidu Research into Caffe.

There is a toy demo in examples/warpctc_captcha, which can train a 2-layer lstm model to recongnize the captcha in an image. To run the demo, you should first generate the dataset for training and validating with the python scripts, then it is an ordinary tranning procedure using Caffe.

Here is also a similar repo implemented by PyTorch. See captcha-recognition for detail.

This repo is a personal project.

Issue when building the project

Please comment the following lines in Makefile.config, otherwise it may cause gradient explosion when training because old CUDA runtime library doesn't support __shlf_down used in Baidu's implementation. See issue 1 for detail(discussion in Chinese).

-gencode arch=compute_20,code=sm_20 
-gencode arch=compute_20,code=sm_21

How to run the demo

In this demo, captcha images can contain digit sequence with different length(more specifically, 1~5 digits). CTC loss is very suitable for this kind of variable length sequence learning. See the three images below for detail of the examples in the demo.

captcha image with 3 digits captcha image with 4 digits captcha image with 5 digits

The original WarpCTC by Baidu Research supports multi-thread processing when using CPU. However it is not supported by this repo. So GPU is necessary for the following experiment, otherwise the running time will be unbearably long. Or you can reduce the dataset size to save time.

To run the demo, first, make sure you are in $CAFFE_ROOT directory. Then, run the scripts to generate data using python captcha library and hdf5 files for training and testing.

# generate data
python examples/warpctc_captcha/generate_captcha.py
# generate hdf5 files
python examples/warpctc_captcha/generate_dataset.py

Due to different hardware capabilities, this process may take a different time. Then you should find captcha images in directory $CAFFE_ROOT/data/captcha. You can change the parameters in the above two scripts to get larger dataset and use more threads to accerate the process.

Then, you can run the bash script to train the 2-layer lstm model using ctc loss.

./examples/warpctc_captcha/train.sh

Have a cup of coffee when training!

Demo results

I ran the demo for several times and the model can converge finally. The accuracy of the model is not too high, but enough to prove the power of the naive 2-layer lstm network trained with CTC loss.

trainning loss result test loss result test accuracy

The model I trainned can be downloaded from Google Drive.

Check ./examples/warpctc_captcha/captcha_prediction.cpp for deployment. It is modified based on examples/cpp_classification/classification.cpp.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].