All Projects → sml2h3 → ocr_api_server

sml2h3 / ocr_api_server

Licence: Apache-2.0 license
使用ddddocr的最简api搭建项目,支持docker

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to ocr api server

ddddocr
带带弟弟 通用验证码识别OCR pypi版
Stars: ✭ 4,093 (+1743.69%)
Mutual labels:  captcha, ddddocr
CapMonsterCloud
a C# wrapper for CapMonster Cloud API
Stars: ✭ 17 (-92.34%)
Mutual labels:  captcha
dcat-auth-captcha
Sliding captcha for dcat-admin auth / dcat-admin登陆 滑动验证插件 多平台支持
Stars: ✭ 38 (-82.88%)
Mutual labels:  captcha
Captcha-Cracking
Crack number and Chinese captcha with both traditional and deep learning methods, based on Torch and python.
Stars: ✭ 35 (-84.23%)
Mutual labels:  captcha
dcat-login-captcha
Dcat-admin 登陆验证码
Stars: ✭ 24 (-89.19%)
Mutual labels:  captcha
captcha-canvas
A captcha generator by using skia-canvas.
Stars: ✭ 40 (-81.98%)
Mutual labels:  captcha
captcha-mini
captcha-mini.js是一个生成验证码的插件,使用js和canvas生成的,确保后端服务被暴力攻击,简单判断人机以及系统的安全性,体积小,功能多,支持配置。展示地址:https://www.mwcxs.top/static/testTool/demo/index.html
Stars: ✭ 98 (-55.86%)
Mutual labels:  captcha
EasyShiro
基于 RBAC 模型功能全面的 Shiro 安全集成&简化&扩展组件。Shiro integration & simplifies & Extension component based RBAC
Stars: ✭ 47 (-78.83%)
Mutual labels:  captcha
DNTCaptcha.Core
DNTCaptcha.Core is a captcha generator and validator for ASP.NET Core applications
Stars: ✭ 181 (-18.47%)
Mutual labels:  captcha
RARBG-scraper
With Selenium headless browsing and CAPTCHA solving
Stars: ✭ 38 (-82.88%)
Mutual labels:  captcha
simple-recaptcha-v3
🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
Stars: ✭ 25 (-88.74%)
Mutual labels:  captcha
Bearcat captcha
熊猫识别不定长验证码,基于tensorflow2.2(tensorflow2.3也可以运行)轻松就能练出不错的模型
Stars: ✭ 67 (-69.82%)
Mutual labels:  captcha
Formidable
The PHP pragmatic forms library
Stars: ✭ 116 (-47.75%)
Mutual labels:  captcha
recaptcha2
Easy verifier for google reCAPTCHA version 2 for Node.js and Express.js
Stars: ✭ 48 (-78.38%)
Mutual labels:  captcha
Server-Captcha
Protect Your Server From Automated Bots With Captcha Now !
Stars: ✭ 18 (-91.89%)
Mutual labels:  captcha
TikTokBot
Bot save videos from instagram and then post them to Tik-Tok
Stars: ✭ 21 (-90.54%)
Mutual labels:  captcha
wp-recaptcha-integration
WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
Stars: ✭ 50 (-77.48%)
Mutual labels:  captcha
antirobot aiogram
Телеграм бот для блокировки спама
Stars: ✭ 26 (-88.29%)
Mutual labels:  captcha
scp-079-captcha
Provide challenges for newly joined members
Stars: ✭ 52 (-76.58%)
Mutual labels:  captcha
wayang
Remote Chrome Headless , bypass reCAPTCHA dan anything that needs to be done by human
Stars: ✭ 32 (-85.59%)
Mutual labels:  captcha

ocr_api_server

使用ddddocr的最简api搭建项目,支持docker

建议python版本3.7-3.9 64位

再有不好好看文档的我就不管了啊!!!

运行方式

最简单运行方式

# 安装依赖
pip install -r requirements.txt -i https://pypi.douban.com/simple

# 运行  可选参数如下
# --port 9898 指定端口,默认为9898
# --ocr 开启ocr模块 默认开启
# --old 只有ocr模块开启的情况下生效 默认不开启
# --det 开启目标检测模式

# 最简单运行方式,只开启ocr模块并以新模型计算
python ocr_server.py --port 9898 --ocr

# 开启ocr模块并使用旧模型计算
python ocr_server.py --port 9898 --ocr --old

# 只开启目标检测模块
python ocr_server.py --port 9898  --det

# 同时开启ocr模块以及目标检测模块
python ocr_server.py --port 9898 --ocr --det

# 同时开启ocr模块并使用旧模型计算以及目标检测模块
python ocr_server.py --port 9898 --ocr --old --det

docker运行方式(目测只能在Linux下部署)

git clone https://github.com/sml2h3/ocr_api_server.git
# docker怎么安装?百度吧

cd ocr_api_server

# 修改entrypoint.sh中的参数,具体参数往上翻,默认9898端口,同时开启ocr模块以及目标检测模块

# 编译镜像
docker build -t ocr_server:v1 .

# 运行镜像
docker run -p 9898:9898 -d ocr_server:v1

接口

具体请看test_api.py文件

# 1、测试是否启动成功,可以通过直接GET访问http://{host}:{port}/ping来测试,如果返回pong则启动成功

# 2、OCR/目标检测请求接口格式:

# http://{host}:{port}/{opt}/{img_type}/{ret_type}
# opt:操作类型 ocr=OCR det=目标检测 slide=滑块(match和compare两种算法,默认为compare)
# img_type: 数据类型 file=文件上传方式 b64=base64(imgbyte)方式 默认为file方式
# ret_type: 返回类型 json=返回json(识别出错会在msg里返回错误信息) text=返回文本格式(识别出错时回直接返回空文本)

# 例子:

# OCR请求
# resp = requests.post("http://{host}:{port}/ocr/file", files={'image': image_bytes})
# resp = requests.post("http://{host}:{port}/ocr/b64/text", data=base64.b64encode(file).decode())

# 目标检测请求
# resp = requests.post("http://{host}:{port}/det/file", files={'image': image_bytes})
# resp = requests.post("http://{host}:{port}/det/b64/json", data=base64.b64encode(file).decode())

# 滑块识别请求
# resp = requests.post("http://{host}:{port}/slide/match/file", files={'target_img': target_bytes, 'bg_img': bg_bytes})
# jsonstr = json.dumps({'target_img': target_b64str, 'bg_img': bg_b64str})
# resp = requests.post("http://{host}:{port}/slide/compare/b64", files=base64.b64encode(jsonstr.encode()).decode())
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].