需要安装tesseract-ocr
#如是debian
apt-get install tesseract-ocr
#如是centos
yum install tesseract
下载py,或者
wget https://u.iheit.com/index.py
安装python
#如是debian
apt-get install python3
apt-get install python3-pip
安装依赖
pip3 install requests
pip3 install pytesseract
pip3 install flask
pip3 install Pillow
后台执行
python3 index.py
#或者使用screen
screen -dmS qdocr python3 index.py
默认地址为http://localhost:5000/getCode
然后更改配置文件中的api地址(稍后更新)
api源码大部分来自https://github.com/teenyda/qingdao
在百度ai申请带数字识别的应用,填入配置文件即可
编译包下载: https://github.com/kukume/unicom/releases/
- JDK1.8
- MySQL(如使用mysql)
- nginx/apache(如需域名访问)
快捷方法安装吧。
以宝塔为例:
安装宝塔
#centos
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
#ubuntu
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
#debian
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
打开宝塔面板,只需要在应用商店安装好tomcat9
就会带有JDK1.8
环境。
然后在应用商店安装好mysql
。
下载编译包,更改application.yml
中的配置
然后把unicom.jar
和application.yml
放到同一文件夹下,比如我的文件都在/root/java
文件下
运行
cd /root/java
java -jar unicom.jar
如需后台运行,可以使用screen
cd /root/java
screen -dmS unicom java -jar unicom.jar
运行之后打开http://IP地址:8099
即可
如果需要域名访问,在宝塔中添加反向代理,代理地址设置为http://localhost:8099
即可