• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

captcha_platform: [验证码识别-部署] This project is based on CNN+BLSTM+CTC to re ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

captcha_platform

开源软件地址:

https://gitee.com/kerlomz/captcha_platform

开源软件介绍:

Build Status

Project Introduction

This project is based on CNN+BLSTM+CTC to realize verification code identification.This project is only for deployment models, If you need to train the model, please move to https://github.com/kerlomz/captcha_trainer

Informed

  1. The default requirements.txt will install CPU version, Change "requirements.txt" from "TensorFlow" to "TensorFlow-GPU" to Switch to GPU version, Use the GPU version to install the corresponding CUDA and cuDNN.
  2. demo.py: An example of how to call a prediction method.
  3. The model folder folder is used to store model configuration files such as model.yaml.
  4. The graph folder is used to store compiled models such as model.pb
  5. The deployment service will automatically load all the models in the model configuration. When a new model configuration is added, the corresponding compilation model in the graph folder will be automatically loaded, so if you need to add it, please copy the corresponding compilation model to the graph path first, then add the model configuration.

Start

  1. Install the python 3.7 environment (with pip)
  2. Install virtualenv pip3 install virtualenv
  3. Create a separate virtual environment for the project:
    virtualenv -p /usr/bin/python3 venv # venv is the name of the virtual environment.cd venv/ # venv is the name of the virtual environment.source bin/activate # to activate the current virtual environment.cd captcha_platform # captcha_platform is the project path.
  4. pip install -r requirements.txt
  5. Place your trained model.yaml in model folder, and your model.pb in graph folder (create if not exist)
  6. Deploy as follows.

1. Http Version

  1. LinuxDeploy (Linux/Mac):

    1. Port: 5000
    pip install gunicorngunicorn -c deploy.conf.py flask_server:app
    1. Port: 19951
    python flask_server.py
    1. Port: 19952
    python tornado_server.py
    1. Port: 19953
    python sanic_server.py
  2. WindowsDeploy (Windows):

    python xxx_server.py
  3. Request

    Request URIContent-TypePayload TypeMethod
    http://localhost:[Bind-port]/captcha/v1application/jsonJSONPOST
    ParameterRequiredTypeDescription
    imageYesStringBase64 encoding binary stream
    model_nameNoStringModelName, bindable in yaml configuration

    The request is in JSON format, like: {"image": "base64 encoded image binary stream"}

  4. Response

    Parameter NameTypeDescription
    messageStringIdentify results or error messages
    codeStringStatus Code
    successStringWhether to request success

    The return is in JSON format, like: {"message": "xxxx", "code": 0, "success": true}

2. G-RPC Version

Deploy:

python3 grpc_server.py

Port: 50054

Update G-RPC-CODE

python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./grpc.proto

Directory Structure

- captcha_platform    - grpc_server.py    - flask_server.py    - tornado_server.py    - sanic_server.py    - demo.py    - config.yaml- model    - model-1.yaml    - model-2.yaml    - ...- graph    - Model-1.pb    - ...

Management Model

  1. Load a model
  • Put the trained pb model in the graph folder.
  • Put the trained yaml model configuration file in the model folder.
  1. Unload a model
  • Delete the corresponding yaml configuration file in the model folder.
  • Delete the corresponding pb model file in the graph folder.
  1. Update a model
  • Put the trained pb model in the graph folder.
  • Put the yaml configuration file with "Version" greater than the current version in the model folder.
  • Delete old models and configurations.

License

This project use SATA License (Star And Thank Author License), so you have to star this project before using. Read the license carefully.

Introduction

https://www.jianshu.com/p/80ef04b16efc

Donate

Thank you very much for your support of my project.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap