sml2h3 / ddddocr Goto Github PK
View Code? Open in Web Editor NEW带带弟弟 通用验证码识别OCR pypi版
License: MIT License
带带弟弟 通用验证码识别OCR pypi版
License: MIT License
使用命令 pip install ddddocr
安装时报错:
ERROR: Could not find a version that satisfies the requirement onnxruntime (from ddddocr) (from versions: none)
ERROR: No matching distribution found for onnxruntime
怎么回事?
Python版本:3.10.0
2021-11-17 01:56:58.2197926 [W:onnxruntime:, execution_frame.cc:770 onnxruntime::ExecutionFrame::VerifyOutputSizes] Expected shape from model of {1,19} does not match actual shape of {1,17} for output output
谢谢大佬的识别包, 发现一个问题..
下载的最新版,也试过update, 运行的时候还有这个错误提示.
在这里可以把你觉得识别效果不好的图片发在这里。
希望贴3张以上原图,可以包含原图链接。
系统版本:11.4 (20F71)
设备版本:MacBook Air (M1, 2020)
pip安装提示没有版本可用
ERROR: Cannot install ddddocr==1.0.4, ddddocr==1.0.5 and ddddocr==1.0.6 because these package versions have conflicting dependencies.
首先感谢带带弟弟的开源精神,我是在校大学生,对这方面比较感兴趣,请问如何训练模型,是否开源呢?
import ddddocr 跳这个错误怎么解决
目前只能识别一行内容,如果有多行内容,则无输出
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x00000219E6A236D0>
如题
pip无法安装ddddocr,换了好几个源,都提示这个
ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
ERROR: No matching distribution found for onnxruntime
These packages are smaller than the two other packages above because they do not contain any GUI functionality (not compiled with Qt / other GUI components). This means that the packages avoid a heavy dependency chain to X11 libraries and you will have for example smaller Docker images as a result. You should always use these packages if you do not use cv2.imshow et al. or you are using some other package (such as PyQt) than OpenCV to create your GUI.
Option 3 - Headless main modules package: pip install opencv-python-headless
Option 4 - Headless full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python-headless (check contrib/extra modules listing from OpenCV documentation)
Traceback (most recent call last):
File "hello.py", line 8, in
import cv2
File "/usr/local/lib/python3.8/site-packages/cv2/init.py", line 8, in
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
下载过后错误又变为
libGL.so.0
pip install ddddocr
Collecting ddddocr
Using cached ddddocr-1.0.6-py3-none-any.whl (6.9 MB)
Using cached ddddocr-1.0.5-py3-none-any.whl (3.3 MB)
Collecting torchvision
Using cached torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB)
Collecting ddddocr
Using cached ddddocr-1.0.4.tar.gz (3.3 MB)
Requirement already satisfied: numpy in e:\program files\python\python39-32\lib\site-packages (from ddddocr) (1.20.3)
ERROR: Cannot install ddddocr==1.0.4, ddddocr==1.0.5 and ddddocr==1.0.6 because these package versions have conflicting dependencies.
The conflict is caused by:
ddddocr 1.0.6 depends on onnxruntime
ddddocr 1.0.5 depends on onnxruntime
ddddocr 1.0.4 depends on torchvision==0.9.1
To fix this you could try to:
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
若使用opencv-python则“libGL.so.1: cannot open shared object file: No such file or directory”
opencv-python-headless则
”Traceback (most recent call last):
File "main.py", line 1, in
import ddddocr
File "/home/runner/ocr/venv/lib/python3.8/site-packages/ddddocr/init.py", line 12, in
import cv2
File "/home/runner/ocr/venv/lib/python3.8/site-packages/cv2/init.py", line 190, in
bootstrap()
File "/home/runner/ocr/venv/lib/python3.8/site-packages/cv2/init.py", line 120, in bootstrap
load_first_config(['config.py'], True)
File "/home/runner/ocr/venv/lib/python3.8/site-packages/cv2/init.py", line 118, in load_first_config
raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
ImportError: OpenCV loader: missing configuration file: ['config.py']. Check OpenCV installation.“
(base) F:>pip install ddddocr==1.0.6
ERROR: Could not find a version that satisfies the requirement ddddocr==1.0.6 (from versions: none)
ERROR: No matching distribution found for ddddocr==1.0.6
怎么训练通用的模型
之前是显示 no such file:common.onnx,后来我修改了spec,把common.onnx加入了,可以在我自己的电脑执行exe。
但是到没有安装python的电脑环境下,就出现闪退了。(我的py代码中有selenium的部分,我还特意把webdriver.exe和生成的exe放到了同一目录,依旧闪退)
请问框架如何开启英文识别大小写呢
[ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\ADMINI~1\AppData\Local
\Temp\2_MEI30202\ddddocr\common.onnx failed:Load model C:\Users\ADMINI~1\AppData\Local
\Temp\2_MEI30202\ddddocr\common.onnx failed. File doesn't exist
麻烦帮忙看下,十分感谢。
比如我知道这个验证码是四位英文字符和数字组合,能不能限定范围,提高识别率呢?
Traceback (most recent call last):
File "yzm.py", line 5, in <module>
ocr = ddddocr.DdddOcr(old=True)
TypeError: __init__() got an unexpected keyword argument 'old'
如题。谢谢!
@sml2h3 您好,请问您部署过GPU版本吗?我将模型设置如下
self.ocr = ddddocr.DdddOcr(use_gpu=True, old=True)
在推理时会有如下报错
TypeError: load_model(): incompatible function arguments. The following argument types are supported:
1. (self: onnxruntime.capi.onnxruntime_pybind11_state.InferenceSession, arg0: List[str]) -> None
Invoked with: <onnxruntime.capi.onnxruntime_pybind11_state.InferenceSession object at 0x7f3754e7dce0>, [('CUDAExecutionProvider', {'device_id': 0, 'arena_extend_strategy': 'kNextPowerOfTwo', 'cuda_mem_limit': 1073741824, 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': True})]
您有什么解决办法吗? 感谢!
import ddddocr
环境:Python 3.7.3,win10
Traceback (most recent call last):
File "", line 1, in
File "D:\python3\lib\site-packages\ddddocr_init_.py", line 9, in
import onnxruntime
File "D:\python3\lib\site-packages\onnxruntime_init_.py", line 35, in
raise import_capi_exception
File "D:\python3\lib\site-packages\onnxruntime_init_.py", line 23, in
from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, set_seed,
File "D:\python3\lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
ImportError: DLL load failed: 找不到指定的模块。
Traceback (most recent call last):
File "D:/python/201.py", line 3, in
ocr = ddddocr.DdddOcr()
File "D:\python\lib\site-packages\ddddocr_init_.py", line 29, in init
self.__ort_session = onnxruntime.InferenceSession(self.__graph_path, providers=self.__providers)
File "D:\python\lib\site-packages\onnxruntime\capi\session.py", line 195, in init
self._create_inference_session(providers, provider_options)
File "D:\python\lib\site-packages\onnxruntime\capi\session.py", line 200, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from D:\python\lib\site-packages\ddddocr\common.onnx failed:Fatal error: DynamicQuantizeLSTM is not a registered function/op
识别不了验证码里的小数点。。。
显示 ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'onnxruntime'
提示AttributeError: partially initialized module 'ddddocr' has no attribute 'DdddOcr' (most likely due to a circular import)
2022-02-08 16:47:20,950 - 日志 - ERROR - [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed:Load model C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed. File doesn't exist
2022-02-08 16:47:21,474 - 日志 - ERROR - 方国民失败[ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed:Load model C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed. File doesn't exist
2022-02-08 16:47:21,853 - 日志 - ERROR - 田东礼失败[ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed:Load model C:\Users\ADMINI1\AppData\Local\Temp_MEI13522\ddddocr\common_old.onnx failed. File doesn't exist
感谢!~
Fatal error: DynamicQuantizeLSTM is not a registered function/op
pip3 install ddddocr Collecting ddddocr Using cached ddddocr-1.0.6-py3-none-any.whl (6.9 MB) Collecting Pillow Using cached Pillow-9.0.1-cp310-cp310-macosx_10_10_universal2.whl (3.3 MB) ERROR: Could not find a version that satisfies the requirement onnxruntime (from ddddocr) (from versions: none) ERROR: No matching distribution found for onnxruntime
Python 3.10.2
不是M1
macOS BigSur 11.6.3 (20G415)
MacBook Pro (Retina, 13-inch, Late 2013) Intel
也不支持?
传入的base64字符串有什么规则要求吗
想自己尝试一下训练ddddocr使用的模型,但是自己的数据集一直有问题。不够全面,而且准确性一直是0
AttributeError: partially initialized module 'ddddocr' has no attribute 'DdddOcr' (most likely due to a circular import)
如题。M1 Mac安装报错。请问是系统问题吗?
ERROR: Cannot install ddddocr==1.0.6 and ddddocr==1.1.0 because these package versions have conflicting dependencies.
The conflict is caused by:
ddddocr 1.1.0 depends on onnxruntime
ddddocr 1.0.6 depends on onnxruntime
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
monkey@benboerba ~ % ~/Documents/python_env/wuyou/bin/pip3 install onnxruntime
ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
ERROR: No matching distribution found for onnxruntime
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.