Git Product home page Git Product logo

cnn_lstm_ctc_ocr_for_icpr's Introduction

Forked from weinman/cnn_lstm_ctc_ocr for the ICPR MTWI 2018 challenge 1

Introduction

This is a repository forked from weinman/cnn_lstm_ctc_ocr for the ICPR MTWI 2018 challenge1.
Origin Repository: weinman/cnn_lstm_ctc_ocr - A tensorflow implementation of end to end text recognition
Origin Author: weinman

Author: Feng zhang
Email: [email protected]

Contents

  1. Transform
  2. Models
  3. Demo
  4. Train
  5. Test
  6. Results

Transform

You should cut the data by yourself.Use the target_cut.py, you only need to change the data path to your own origin data.I use the dataset like ICPR MTWI 2018. Note,I use Affine changes the change the Oblique picture to rectangle.So I need the clockwise direction of target label. Use the getTxt.py to change the label's direction.

Next, use mjsynth-tfrecord.py to change your data into tfrecord.You can Find the way in [weinman/cnn_lstm_ctc_ocr/Makefile] You only need to change some paths.

Models

I use the new word_dictionary which consists of English, Chinese and number.I only upload a old pretrain model,it works badly. If you train it for one day with your data,it will work well.And,I add some data augmentation for the model. You also can change the model to denseNet,it will work better.Do as follows in the train.py :

Import denseNet 
%features,sequence_length = model.convnet_layers( image, width, mode)
features,sequence_length = zf_mod_denseNet2.Dense_net( image, width, mode)

I only share the origin Model which is trained on ICPR MTWI 2018 (train): [model_download].The password is 2h1z. Some English data can find in [weinman]

Demo

Download models and copy it to data/model. Then,Run:

python validate.py  your picture's path
eg.python validate.py E:/1.jpg

Train

I already upload MTWI 2018 data£¬You can download and copy to data/model/.After that ,train the model for a day,you can get your own model.[ICPR MTWI 2018 data+extra Eng-data+Eng-data].The password is diyj. When we make your data to tfrecord,You can train. I suggest you had better use your own data.

cd src
python train.py

Test

use also can test the tfrecord's accuracy.[usage] put your data in src/data/val and do as follows:

cd src;
python test.py

Results

Here are some results on ICPR MTWI 2018:
image

Enjoy yourself

cnn_lstm_ctc_ocr_for_icpr's People

Contributors

zfxxfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cnn_lstm_ctc_ocr_for_icpr's Issues

validate.py使用问题

请问当初你是如何使用validate.py对整个测试集进行遍历呢?因为我看到输入图像要求维度是(31,?,1)而显然需要对测试数据进行resize,那么请问你用什么方法对测试数据进行resize呢?我直接用了image.resize((image.size[0], 31),最终效果并不好,请问你是用什么方法呢?

crop出来的文本图片不正常

你好,你的生成文本图片的函数,生成的文本图片感觉都是做了镜像?
本来水平文本都镜像了?
这样回影响训练吗?

target_cut.py 可能有点问题

首先感谢分享.

Image_list = os.listdir(Img_dataset_dir)

Label_list = os.listdir(Label_dataset_dir)
直接读取文件名可能会用顺序不一样的问题, macos python3下以及centos python3下都会有, windows下好像不会

然后处理结果都是镜像翻转正常么...

如何利用jpg文件和txt文件生成tfrecord?

我下载了标注文件,有jpg图片和txt标注,怎么生成tfrecord呢?用mjsynth-tfrecord.py的话,里面需要的annotation_val.txt文件是什么内容,我看后续处理是文件名 xxx,这后面xxx是什么iamge_texts?是干嘛的

How many steps do you run when training denseNet on IPCR dataset?

Much thanks to your work!

I haved trained the network for 70k steps and the effect is still bad. As your uploaded model's step is 1405532, I really need a long way to go, right?

Another question is, model.ckpt-1405532 will predict 5530 characters, but the word_dict.py contains 16389 characters. Where's the corresponding word_dict for the demo model?

denseNet

Maybe the model denseNet is not convergent. I think denseNet need some improvement.

There is some problems in demo, which some weights in checkpoint not found.

NotFoundError (see above for traceback): Key rnn/bdrnn2/fw/lstm_cell/weights not found in checkpoint
[[Node: save/RestoreV2_39 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_39/tensor_names, save/RestoreV2_39/shape_and_slices)]]

Can you know how to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.