Skip to main content

A Tools for use algorithm for verification recognition

Project description

rpa_verification

用于自主训练测试上线部署验证码算法

版本号

0.1.0

使用方法

安装

使用pip命令安装

pip install rpa-ocr

训练

定义好相关参数然后使用train.main()命令训练

import rpa_ocr
app_scenes = ""
alphabet_mode = ""
data_path = ""
model_path = ""
train = rpa_ocr.Train(app_scenes=app_scenes,
                      alphabet_mode=alphabet_mode,
                      data_path=data_path,
                      model_path=model_path)
train.main()

参数说明

 app_scenes: 当前验证码的使用场景,也是全局标识符
 alphabet_mode: 使用哪种模式的字母表,目前支持"ch"(中文),"eng"(英文大小写),"ENG"(英文大写)
 data_path: 存储数据的位置,按照图片,命名为label
 model_path: model训练完后的保存地址
 short_size: 图片的高度,必须是16的倍数。default:32
 verification_length: 验证码的长度。default:4
 device: 使用cpu还是gpu进行训练,两个模式:"cpu" or "cuda"。default:"cpu"
 epochs: 训练模型的轮数。default:1200
 lr: 学习率。default:1e-3
 batch_size: 每一个batch的大小。default:256
 num_works: 使用多进行进行数据处理,使用进程数。default:0
 target_acc: 目标准确率,如果达到目标准确率将提前结束训练。default:0.95
 cloud_service: 是否将训练好的模型自动上传到云端。default:True

预测

定义好相关参数,然后使用crnn.predict(image)进行预测

目前支持的image格式为opencv,pillow读入和base64编码后的图片

import rpa_ocr
import cv2
app_scenes = ""
model_path = ""
image_path = ""
image = cv2.imread(image_path)
crnn = rpa_ocr.CRNNInference(app_scenes=app_scenes,
                             model_path=model_path)
crnn.predict(image)

参数说明

 app_scenes: 当前验证码的使用场景,也是全局标识符
 alphabet_mode: 使用哪种模式的字母表,目前支持"ch"(中文),"eng"(英文大小写),"ENG"(英文大写)。default:"eng"
 model_path: 使用model所在文件夹目录
 short_size: 图片的高度,必须是16的倍数。default:32
 verification_length: 验证码的长度。default:4
 device: 使用cpu还是gpu进行训练,两个模式:"cpu" or "cuda"。default:"cpu"

TODO LIST

  • 完成训练和测试的一键完成
  • 支持多cpu加速训练
  • 支持自动提前停止训练
  • 针对中文验证码的支持
  • 完成训练后的一键部署到云服务器
  • 完成可以部署到win32
  • 支持文字点选类验证码
  • 增加对滑块验证码的支持
  • 增加对拼图类验证码的支持

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpa_ocr-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpa_ocr-0.1.0-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file rpa_ocr-0.1.0.tar.gz.

File metadata

  • Download URL: rpa_ocr-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

File hashes

Hashes for rpa_ocr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1449bba1b40c01f19bbc5af0f526b03fbb10c7670b387a595b55e338c39a8bec
MD5 a98fcc1c251ac041fa001a87529d8c4b
BLAKE2b-256 158ff6b52be082032834b488a88982684d5e18d42d7c19749bbdebf00b72bdd5

See more details on using hashes here.

File details

Details for the file rpa_ocr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rpa_ocr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

File hashes

Hashes for rpa_ocr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6de483b2e5367e54b15d0d0bfef42b01da084f42399bc5ba0013772692aa5a29
MD5 8433a7c687eab07ef51ffd4d456f22ea
BLAKE2b-256 7021e772a29f37e26016caff7eb99305dbdc6dfc87b1274b863ef780d4a3d34e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page