当前位置:首页 > python > 正文内容

Python三方库ddddocr实现验证码识别

zhangsir3年前 (2022-10-11)python459

Python三方库ddddocr实现验证码识别

环境要求

python >= 3.8

安装三方库

pip install ddddocr -i https://pypi.tuna.tsinghua.edu.cn/simple

参数说明:

参数名参数类型默认值说明
use_gpu
Bool
False
是否使用gpu进行推理,如果该值为False则device_id不生效
device_idint0cuda设备号,目前仅支持单张显卡
img
bytes
无默认值(必填项)图片的bytes格式

代码示例:

import ddddocr
 
ocr = ddddocr.DdddOcr()
with open('1.png', 'rb') as f:
    img_bytes = f.read()
res = ocr.classification(img_bytes)
 
print(res)


zhangsir版权y1防采集https://mianka.xyz

扫描二维码推送至手机访问。

版权声明:本文由zhangsir or zhangmaam发布,如需转载请注明出处。

本文链接:https://mianka.xyz/post/40.html

标签: pythonddddocr
分享给朋友:

“Python三方库ddddocr实现验证码识别” 的相关文章

python之seleniumwire获取network(网络)信息

python之seleniumwire获取请求头参数import time from seleniumwire import webdriver # 创建Chrome驱动程序的新实例 driver = webdriver...

pip安装三方库 国内的一些镜像站点推荐

pip 国内的一些镜像站点推荐镜像套路:使用cmd;输入命令pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名 即可开始安装。清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http...

python selenium find_element_by_xpath 方法已经被弃用的解决办法

背景:在使用最新3.10.4Python版本时候,用selenium进行xpath定位元素,编译器提示:DeprecationWarning:find_element_by_xpath is deprecated. Please use find_element(by=By.XPATH, value...

python 给电脑设置闹钟

python会自动触发windows桌面通知,提示重要事项,比如说:您已工作两小时,该休息了我们可以设定固定时间提示,比如隔10分钟、1小时等用到的第三方库:win10toast - 用于发送桌面通知的工具from win10toast import ToastNoti...

计算机学习视频教程

人工智能机器学习:Python&R实践课程介绍:https://www.aihorizon.cn/1百度网盘地址: https://pan.baidu.com/s/1a743NTKFRjsgexMTagWooA?pwd=e39j动手使用Python进行自然语言处理(NLP)课程介绍:http...

python selenium 使用代理ip

代码如下:from selenium import webdriver chromeOptions = webdriver.ChromeOptions() chromeOptions.add_argument("--proxy-serv...