YinAoXiong / 12306_code_server
- четверг, 26 декабря 2019 г. в 00:17:50
Python
该仓库用于构建自托管的12306验证码识别服务器
该项目用于构建自托管的12306验证码识别服务器,本项目的全部模型和部分代码来自于此项目 easy12306,使用该项目构建的api符合 12306购票小助手云打码格式可以直接调用。
提供一个部署好的线上版本, https://12306.yinaoxiong.cn,部署在腾讯云1核1G的学生机上不保证可用性,服务状态可以通过 https://stats.uptimerobot.com/oyKyLhjJQ/783635180查看.
/verify/base64/{
"code": 0,
"data": [
"1", //答案图片的编号数组
"3"
],
"massage": "识别成功"
}
{
"code": 1,
"data": [
],
"massage": "识别失败"
}其中arm平台建议通过docker运行
使用docker可以使用如下命令快速部署:
docker run -d -p 8080:80 --name 12306 yinaoxiong/12306_code_serverversion: "3"
services:
code_12306:
image: yinaoxiong/12306_code_server
ports:
- 5002:80 #可以根据需要修改端口
environment:
- WORKERS=1 #gunicorn works 默认为1可以根据服务器配置自行调整
restart: always
克隆并进入项目
git clone https://github.com/YinAoXiong/12306_code_server.git
cd 12306_code_server安装依赖 自行根据平台和python选择对应的tflite(下面的例子为amd64,python3.7,其他情况对应的下载地址见 https://www.tensorflow.org/lite/guide/python,可自行在requirements.txt中替换)
pip3 install -r requirements.txt下载模型文件
bash download_model.sh运行 默认workers为1,使用80端口,可以自行修改 gunicorn.conf
gunicorn app:app -c gunicorn.conf.py不推荐在arm平台上使用源码部署,依赖安装有些麻烦.