PFCCLab / PPOCRLabel

PPOCRLabelv2 is a semi-automatic graphic annotation tool suitable for OCR field, with built-in PP-OCR model to automatically detect and re-recognize data.
105 stars 32 forks source link

按照安装指导安装后执行指定无任何反应,大佬们给指导指导 #60

Closed BotAndyGao closed 2 months ago

BotAndyGao commented 2 months ago

0. 安装环境

1. 安装与运行

1.1 安装PaddlePaddle

# 如果您的机器是CPU,请运行以下命令安装
pip3 install paddlepaddle==2.6.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

1.2 安装与运行PPOCRLabel

PPOCRLabel可通过whl包与Python脚本两种方式启动,whl包形式启动更加方便,python脚本启动便于二次开发

1.2.1 通过whl包安装与运行

Windows
pip3 install PPOCRLabel  # 安装

# 选择标签模式来启动
PPOCRLabel --lang ch  # 启动【普通模式】,用于打【检测+识别】场景的标签
PPOCRLabel --lang ch --kie True  # 启动 【KIE 模式】,用于打【检测+识别+关键字提取】场景的标签
GreatV commented 2 months ago

clone下来用python PPOCRLabel.py运行一下试试。

BotAndyGao commented 2 months ago

clone下来用python PPOCRLabel.py运行一下试试。 好,我clone tagV2.1.6的代码试一下 准备使用环境: python 3.10.14 opencv-contrib-python==4.10.0.84 opencv-python==4.10.0.84 paddleocr==2.8.1 paddlepaddle==2.6.1

BotAndyGao commented 2 months ago

clone下来用python PPOCRLabel.py运行一下试试。

感谢支持!

源码下安装运行步骤

git clone PPOCRLabel源码

cd PPOCRLabel

pip3 install paddlepaddle==2.6.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 正常安装paddlepaddle==2.6.1

pip3 install paddleocr==2.8.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

pip3 install openpyxl

# Successfully installed et-xmlfile-1.1.0 openpyxl-3.1.5

pip3 install PyQt5

# Successfully installed PyQt5-5.15.11 PyQt5-Qt5-5.15.2 PyQt5-sip-12.15.0

python PPOCRLabel.py

# 成功启动界面
BotAndyGao commented 2 months ago

已解决

BotAndyGao commented 2 months ago

1.2.4 Pyinstaller打包并运行

cd ./PPOCRLabel
# 安装pyinstaller
pip install pyinstaller

# 重新生成资源
pyrcc5 -o libs/resources.py resources.qrc

# 打包可执行程序
pyinstaller -c PPOCRLabel.py --collect-all paddleocr --collect-all pyclipper --collect-all imghdr --collect-all skimage --collect-all imgaug --collect-all scipy.io --collect-all lmdb --collect-all paddle --hidden-import=pyqt5  -p ./libs -p ./ -p ./data -p ./resources -F

# 运行dist中的可执行程序,以windows为例
PPOCRLabel.exe --lang ch

问题:按照1.2.4步骤在源码上打包,打包过程没问题,打包也成功。但是运行dist中的可执行程序时报错。希望大佬再给看看什么原因?

错误信息如下:

(PaddleOCRLadelTest) E:\temp\PPOCRLabel\dist>PPOCRLabel.exe --lang ch
Traceback (most recent call last):
  File "PPOCRLabel.py", line 68, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "paddleocr\__init__.py", line 14, in <module>
    from .paddleocr import *
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "paddleocr\paddleocr.py", line 59, in <module>
    from ppocr.utils.network import (
  File "C:\Users\gaoxu\AppData\Local\Temp\_MEI74762\paddleocr\ppocr\utils\network.py", line 18, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
[PYI-12540:ERROR] Failed to execute script 'PPOCRLabel' due to unhandled exception!
GreatV commented 2 months ago

你把缺的包安装上就好了,requests。

BotAndyGao commented 2 months ago

你把缺的包安装上就好了,requests。

安装这个包应该很好操作,但是打包的问题别人也会遇到,后续会对这个问题做升级吧?要不别人都会出错,你们不也麻烦吗!