Giter Club home page Giter Club logo

12306-captcha's Introduction

12306-captcha License

12306验证码识别

1. 训练

1.1 准备工作

  • 下载caffe并编译, 具体可参考官方文档, 此处不再赘述.
  • 修改src/config.py中的caffe根目录和项目根目录.
  • pip安装easydict, skimage等.

1.2 数据

  • 通过运行src/tools/download_image.py, 会将12306验证码下载至data/download/all目录.
  • 下载完成后, 通过运行src/tools/cut_image.py, 会将其裁剪为图片和文字两部分, 分别放在data/download/image目录和data/download/words目录.
  • 然后手工对其进行分类, 分别放至data/imagedata/words目录. 可以将其分为两部分,分别放在对应的train和test目录.比如,一个示例目录如下:
    -image
    --test
    ---蜡烛
    ----1-1.jpg
    ---沙漠
    ----2-1.jpg
    --train
    ---蜡烛
    ----1-2.jpg
    ---沙漠
    ----2-2.jpg
    
  • 运行src/image/scripts/create_data.py, 将会生成对应的train.txt和test.txt, 里面包含着训练和测试文件及其类别列表.
  • 运行src/image/scripts/create_lmdb.sh, 将会生成对应的lmdb文件.

1.3 参数

可以根据实际情况对src/image/model/image_solver.prototxt文件进行修改.具体修改方法可参考其他模型.

1.4 开始训练

src/image/scripts/image_train.shsrc/image/scripts/image_finetune_train.sh脚本分别用来进行从头训练/微调训练, 训练方法可参考caffe模型训练方法.

测试

src/web提供了一个web测试界面, 运行index.py即可. 运行前, 可以更改对应的模型文件名称. 一个简单示例如下:

web-demo

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.