captcha/README.md

1.0 KiB
Raw Permalink Blame History

Captcha Recognition

基于深度神经网络(DNN)的验证码识别

使用方法

  1. 克隆项目到本地
git clone https://git.taurusxin.com/taurusxin/captcha.git
cd captcha
  1. 创建虚拟环境并安装依赖
python -m venv .venv

# Windows
.venv\Scripts\Activate.ps1

# Linux/MacOS
source .venv/bin/activate

# 先安装 PyTorch GPU 版本cuda 12.4
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

# 然后再安装其他依赖
pip install -r requirements.txt
  1. 根据提示生成数据集生成3次数据集分别用于训练用于测试用于验证。
python captcha_gen.py

建议的数据集长度如下:

数据集 长度
Train 50000
Test 1000
Predict 30
  1. 训练模型
python train.py
  1. 测试模型
python test.py
  1. 预测验证码
python predict.py
  1. 输出 onnx 模型
python export_onnx.py