diff --git a/guiocr/utils/ocr_utils.py b/guiocr/utils/ocr_utils.py index cf46a98b9c6867de812f5fe0f355d7337c66e39c..4e2e2089481eac3732a0e44f124e07430ae5f558 100644 --- a/guiocr/utils/ocr_utils.py +++ b/guiocr/utils/ocr_utils.py @@ -39,10 +39,11 @@ class OCR_qt(QObject): # 用于线程启动 self.ocr(self.img_path,self.use_angle,self.cls,self.default_lan) - def ocr(self,img_path='./imgs/11.jpg',use_angle=True,cls=True, lan="ch"): + def ocr(self,img_path='./imgs/11.jpg',use_angle=True,cls=True, lan="ch", use_gpu=0): self.img_path = img_path self.default_lan = lan ocr = PaddleOCR(use_angle_cls=use_angle, + use_gpu=use_gpu, lang=lan) # need to run only once to download and load model into memory result = ocr.ocr(img_path, cls=cls) self.result = result diff --git a/requirements b/requirements new file mode 100644 index 0000000000000000000000000000000000000000..7b7b3c2c7f505a1dbe887754f8413e2b0f023418 --- /dev/null +++ b/requirements @@ -0,0 +1,82 @@ +astor==0.8.1 +Babel==2.9.1 +bce-python-sdk==0.8.64 +cachetools==5.0.0 +certifi==2021.10.8 +cfgv==3.3.1 +charset-normalizer==2.0.10 +click==8.0.3 +cssselect==1.1.0 +cssutils==2.3.0 +cycler==0.11.0 +Cython==0.29.26 +decorator==5.1.1 +distlib==0.3.4 +et-xmlfile==1.1.0 +fasttext==0.9.1 +filelock==3.4.2 +flake8==4.0.1 +Flask==2.0.2 +Flask-Babel==2.0.0 +future==0.18.2 +identify==2.4.2 +idna==3.3 +imageio==2.13.5 +imgaug==0.4.0 +imgviz==1.4.1 +iopath==0.1.9 +itsdangerous==2.0.1 +Jinja2==3.0.3 +kiwisolver==1.3.2 +labelme==4.6.0 +layoutparser @ https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl +lmdb==1.3.0 +lxml==4.7.1 +MarkupSafe==2.0.1 +matplotlib==3.2.2 +mccabe==0.6.1 +networkx==2.6.3 +nodeenv==1.6.0 +numpy==1.22.0 +opencv-contrib-python==4.4.0.46 +opencv-python==4.3.0.36 +openpyxl==3.0.9 +packaging==21.3 +paddleocr==2.3.0.2 +paddlepaddle==2.2.1 +pandas==1.3.5 +Pillow==9.0.0 +platformdirs==2.4.1 +portalocker==2.3.2 +pre-commit==2.16.0 +premailer==3.10.0 +protobuf==3.19.1 +pybind11==2.9.0 +pyclipper==1.3.0.post2 +pycodestyle==2.8.0 +pycryptodome==3.12.0 +pyflakes==2.4.0 +pyparsing==3.0.6 +PyQt5==5.15.2 +PyQt5-Qt5==5.15.2 +PyQt5-sip==12.9.0 +python-dateutil==2.8.2 +python-Levenshtein==0.12.2 +pytz==2021.3 +PyWavelets==1.2.0 +PyYAML==6.0 +QtPy==2.0.0 +requests==2.27.1 +scikit-image==0.19.1 +scipy==1.7.3 +Shapely==1.8.0 +shellcheck-py==0.8.0.3 +six==1.16.0 +termcolor==1.1.0 +tifffile==2021.11.2 +toml==0.10.2 +tqdm==4.62.3 +urllib3==1.26.8 +virtualenv==20.13.0 +visualdl==2.2.3 +Werkzeug==2.0.2