senlinuc / caffe_ocr Goto Github PK
View Code? Open in Web Editor NEW主流ocr算法研究实验性的项目,目前实现了CNN+BLSTM+CTC架构
主流ocr算法研究实验性的项目,目前实现了CNN+BLSTM+CTC架构
Hi, senlinuc, I want to use only your DenseBlock_layer, since I want to integrate it into caffe SSD branch. I know I should add include/caffe/layers/DenseBlock_layer.hpp, src/caffe/layers/DenseBlock_layer.cpp, src/caffe/layers/DenseBock_layers.cu, /src/caffe/test/test_DenseBlock_layer.cpp into the SSD branch of caffe. But this is not enough, because I suffer from error during compilation, Tongcheng's original git also gives on more detail. Can you help to figure out how to do this correctly? Thanks.
想请问有没有tensorflow方面的项目
请问作者在360万图片下是怎么训练的?也是采用小批次一点一点训练的么?如果是的话大概训练多久?
能否共享一下测试代码?
谢谢!
您好,我看了example/ocr下的例子,对label.txt看不太懂,你的label限定是列文本吗?是不是“label1 ;text1;label2;text2”这种形式?
Hi senlinuc,
Thanks for your kindly sharing:).
I noticed that you've tried many improvements based on standard crnn. But there is a significant accuracy drop(especially no lexicon case) with more powerful cnn structures such as inception net and densenet. Do you have some analysis on this? Is it caused by parameter reduction or some thing else? It will be great if you could share your configs for mjsynth experiments. I'm very curious about the 3 models' cnn settings.
Thanks.
网格结构 | predict-CPU | predict-GPU | 准确率-no lexicon | 准确率-lexicon-minctcloss | 模型大小 |
---|---|---|---|---|---|
crnn | 67.13ms | 10.28ms | 0.8435 | 0.9163 | 32MB |
inception-bn-res-blstm | 41.62ms | 8.68ms | 0.7353 | 0.8609 | 15MB |
densenet-res-blstm | N/A | 6.07ms | 0.7548 | 0.893 | 11MB |
您好,关于整合进linux版本caffe,目前卡在warp-ctc相关的几个层(编译总是报错),不知道是否需要特殊处理?
你好,为什么中文训练集都是10个字符长度,他能识别任意长度的中文吗,另外中文应该比英文更难,为什么反而中文的准确率更高了?
您好,请问识别英文的模型文件在哪里呢,我看examples/ocr/里面没有模型文件啊?
DenseBlock_layer.hpp 文件忘记提交了吧
语料库一般都是txt文件,其中有空格和换行情况,怎样保证读取txt时去除这种情况。而且中文与数字占用字节数不同,怎样能够随机截取连续的10个字符?
方法做的挺全的,能不能放个小样本和训练脚本给熟悉下啊
能否分享你已经训练好的模型?
谢谢
在中文实验上很明显backbone(特征提取网络)增强之后,结果变好了。但是真是情况应该是中英文混合,或者整个测试集里面既有英文也有中文,以我的经验来看,感受野大了之后,对英文来说未必是好事。所以backbone的那一栏实验结果,不知道在混合数据集上表现如何?
方便透漏下个人邮箱吗?希望和你通过邮箱有进一步交流。
您好,训练可以使用任意多的字符吗?训练时可以只固定高度吗?
已经解决,遇到新的问题。
在执行void LSTMLayer::FillUnrolledNet(NetParameter* net_param) const 函数时,最后退出函数时报错。
Run-Time Check Failure #2 - Stack around the variable '***' was corrupted.
***是随机的,例如,sum_param、biased_hidden_param、slice_param,output_concat_layer等。
中文的网络只能是280*32么 我自己修改了尺寸 caffe就跑不起来了 需要注意写什么 ?
训练样本生成工具能否尽快公开 @senlinuc
LZ大神好,请问下,是否统计过汉子字符出现的频率?是否平衡???
网络现在有些问题,无法上传完整日志文件,日志文件开头及结尾:
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1120 08:55:48.745501 7100 net.cpp:58] Initializing net from parameters:
name: "ResNet"
state {
phase: TEST
level: 0
}
layer {
name: "data"
type: "Input"
top: "data"
input_param {
shape {
dim: 1
dim: 1
dim: 32
dim: 280
}
}
}
................
..............
layer {
name: "result"
type: "CTCGreedyDecoder"
bottom: "fc1x"
top: "result"
}
I1120 08:55:48.745501 7100 layer_factory.hpp:77] Creating layer data
F1120 08:55:48.745501 7100 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Input (known types: )
请教这个问题原因可能会在哪个地方?谢谢.
看日志应该是input层有问题,我的protobuf版本为3.3.
你好:
我现在在将您的代码迁移到Linux,但是总是编译报错,请问,您使用的是caffe的哪个版本?
三百多万的中文数据集是从新闻语料中自动生成的
说真的,生成的真不错,加入的噪音和模糊与真实条件下的噪音模糊非常相似
能否公开一下生成数据的代码呢?不胜感激
你好,能否提供一下你的中文语料库呢,不胜感激
你好,修改代码支持mulitilabel的时候按照你发的链接就可以么?因为我发现你的代码跟这个链接的还不太一样.
大家好,我这里应用ocr_test项目(densenet-no-blstm网络)测试多张图片识别效果时,当用gpu模式是可以顺利进行。但是,当我应用cpu模式时,会报错:Trying to copy blobs of different sizes.
简单分析以后,发现识别第一张图片时没有问题,但是识别第二张图片时,在DenseBlock_layer层会出现:source.count() != count_ 问题,进而引发报错信息!
ONLY_CPU结果:
I1120 15:23:28.928501 5788 net.cpp:270] This network produces output result
I1120 15:23:28.928501 5788 net.cpp:283] Network initialization done.
I1120 15:23:28.942502 5788 net.cpp:761] Ignoring source layer data
I1120 15:23:28.946501 5788 net.cpp:761] Ignoring source layer ctcloss
[1/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436312_168344715
2.jpg:
[2/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436328_800384098
.jpg:
[3/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436765_255613035
7.jpg:
[4/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20437703_937698549
.jpg:
CUDNN模式 下运行正常:
I1120 16:06:40.445502 6980 net.cpp:228] input does not need backward computatio
n.
I1120 16:06:40.445502 6980 net.cpp:270] This network produces output result
I1120 16:06:40.445502 6980 net.cpp:283] Network initialization done.
I1120 16:06:40.460501 6980 net.cpp:761] Ignoring source layer data
I1120 16:06:40.464501 6980 net.cpp:761] Ignoring source layer ctcloss
[1/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436312_168344715
2.jpg: 美国人不愿意与朝鲜人
[2/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436328_800384098
.jpg: 姻缘也许在以前就已经
[3/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20436765_255613035
7.jpg: 35机队使用的技术风
[4/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20437703_937698549
.jpg: 业(**)公司是亚洲
[5/5]F:\paper\caffe\caffe_package\caffe_package\tools\ch_test\20440484_212718063
0.jpg: ?”已而大悟,她坚持
boost的版本要1.57,好像是3rdparty里面leveldb要链接1.57的lib,但boost 1.57在sourceforge没有vc2015的二进制,还需要自己编一下
senlinuc你好,感谢你的repo。
(1)请问有基于VGG Synthetic Word Dataset数据集的预训练模型可以提供下载么,
我现在测试了基于中文数据的Denseblock网络的识别效果,发现几乎只能识别印刷体的中文字符,这是由于训练样本造成的么
我生成了leveldb格式训练数据,训练过程中,loss除首次正常外后面
总是一个非法数,比如是一个数字除以0这样一个非数字。谢谢。
你好!我看了cnn+blstm+ctc的网络结构,cnn最后输出的是一系列的向量,经过blstm转换成每个向量的预测分布,最后由ctc得到结果。
README中提到“no-blstm”表示没有lstm层,CNN直接对接CTC。这样是如何将向量序列得到预测分布呢?
或者请给我一篇相关论文,不胜感激!
Severity Code Description Project File Line Suppression State
Error (active) declaration is incompatible with "const char *__stdcall cudnnGetErrorString(cudnnStatus_t status)" (declared at line 102 of "c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\cudnn.h") caffe d:\DeepLearning\caffe_ocr\include\caffe\util\cudnn.hpp 20
我目前电脑的配置是win10+cuda8.0+cudnn5.0,请问原文中的cudnn的版本是?
你好,我想请问一下,我用英文数据训练模型,更改了image_data_layer.cpp中数据读取的部分,使list中的label基于lexion转换成每个字母的label序列,网络结构中label数由5990改为37,另外设置new_width:100,new_height:32。
这样修改完,直接运行,但loss一直不降,请问我上面的过程哪里是有问题的吗?谢谢~~
senlinuc,你好
我clone下来你的代码,用vs15打开sln,显示caffe.vcxproj加载错误,暂时没有找到原因,请问你那里工程师可以正常打开的吗
如果确定我的数据中只有7位和6位的,同时我的train.txt是按着顺序来的,这样每个batch里的就都是6位或者7位,那么还需要补blank么?
我把代码改到linux下了 ,编译通过但是训练时提示undefined Layer -WarpCTCLoss ?
你好,从合成的中文数据(https://pan.baidu.com/s/1dFda6R3 )百度网盘下载的图片中有个train.txt里面有
3279606张图,还有个test.txt有364400张,你那张中文数据集的6种不同网络结构的识别率的表格是用了测试集约6万张的数据吗?这个是不是没有在百度网盘的那个图片集合里。
想问下这个“共生成约360万张图片,按9:1分成训练集、验证集,测试集约6万张” 你说的训练集、验证集和测试集的图片都是用同样的方法生成的吗?如果是同样方法生成,那验证集的识别率和测试集应该差不多的吧,想问下你这个6个验证集训练的识别率是多少?
Really nice project btw!
the reason bi-lstm does not affect accuracy because lstm is more likely to model the language model(especially works for English words), but in Chinese, it depends on how you generate your data.
我打开caffe.sln, caffe, libclassification load failed, 重新加载,
出现对话框
error : Value cannot be null.
Parameter name: url
这怎么回事
您的数据集上都使用了哪些字体?是否每个字在不同字体中都要生成?
如果我要加入一些带下划线的数据,在您的数据集上,应该加多少合适?
噪声是用的什么方法?感觉加的不够,自己想多加点。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.