Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议给出PPOCRLabel安装说明 #96

Open
UWPStone opened this issue Oct 23, 2024 · 10 comments
Open

建议给出PPOCRLabel安装说明 #96

UWPStone opened this issue Oct 23, 2024 · 10 comments

Comments

@UWPStone
Copy link

目前因用 python 3.9.0 python 3.10 ,自动安装PPOCRLabel后使用时出现异常:

python 3.9.0 :
initPos PyQt5.QtCore.QPointF(1203.0, 279.8076923076923) Can not recognise the box

python 3.10

"c:\ProgramData\miniconda3\envs\paddlex\Lib\site-packages\PPOCRLabel\libs\canvas.py", line 587, in paintEvent
shape.paint(p)
File "c:\ProgramData\miniconda3\envs\paddlex\Lib\site-packages\PPOCRLabel\libs\shape.py", line 183, in paint
painter.drawText(min_x, min_y, self.label)
TypeError: arguments did not match any overloaded call:
drawText(self, p: Union[QPointF, QPoint], s: Optional[str]): argument 1 has unexpected type 'float'
drawText(self, rectangle: QRectF, flags: int, text: Optional[str]): argument 1 has unexpected type 'float'
drawText(self, rectangle: QRect, flags: int, text: Optional[str]): argument 1 has unexpected type 'float'
drawText(self, rectangle: QRectF, text: Optional[str], option: QTextOption = QTextOption()): argument 1 has unexpected type 'float'
drawText(self, p: QPoint, s: Optional[str]): argument 1 has unexpected type 'float'
drawText(self, x: int, y: int, width: int, height: int, flags: int, text: Optional[str]): argument 1 has unexpected type 'float'
drawText(self, x: int, y: int, s: Optional[str]): argument 1 has unexpected type 'float'
QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
QPainter::begin: A paint device can only be painted by one painter at a time.
QPainter::translate: Painter not active
QPainter::worldTransform: Painter not active
QWidgetEffectSourcePrivate::pixmap: Painter not active
QPainter::save: Painter not active
QPainter::setOpacity: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::begin: Painter already active

建议给出安装说明,谢谢

@GreatV
Copy link
Collaborator

GreatV commented Oct 23, 2024

你用的是哪个版本的ppocrlabel

@GreatV
Copy link
Collaborator

GreatV commented Oct 23, 2024

@UWPStone
Copy link
Author

python3.9 python3.10 环境下同样的安装步骤:

1.1 Install PaddlePaddle
pip3 install --upgrade pip
python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu123/

1.2 Install and Run PPOCRLabel
pip install PPOCRLabel # install

    # Select label mode and run
    python PPOCRLabel.py --lang ch --kie True --gpu

在此前我安装了PaddleX:
参考:
PaddlePaddle/PaddleX#1849
https://mp.weixin.qq.com/s/5weZTqmhNeG6n9joneQnCA

CUDA版本:12.3
CUDNN版本: cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip
Python版本:3.10

从 Gitee clone 源码
git clone https://gitee.com/paddlepaddle/PaddleX.git

PyQt5 5.15.11
opencv-python 4.5.5.64
opencv-contrib-python 4.6.0.66
paddleocr 0.1.0.dev1+g7bac051.d20241024
paddlepaddle-gpu 3.0.0b1
PPOCRLabel 2.1.10

@GreatV
Copy link
Collaborator

GreatV commented Oct 24, 2024

你这个是成功了还是失败了

@UWPStone
Copy link
Author

安装都是成功的,使用过程中有报错。

@GreatV
Copy link
Collaborator

GreatV commented Oct 24, 2024

是kie任务的时候不行吗,普通标注可以吗

@UWPStone
Copy link
Author

UWPStone commented Oct 24, 2024

shape.py", line 183, 参考其他已解决的issues: 修改为int . python 3.10 可以了 。

普通标注没试过,
我一般用 python PPOCRLabel.py --lang ch --kie True --gpu

@GreatV
Copy link
Collaborator

GreatV commented Oct 24, 2024

欢迎提交一个PR把你的修改同步到仓库里来

@UWPStone
Copy link
Author

怎么提交 ? 我不会。

@GreatV
Copy link
Collaborator

GreatV commented Oct 24, 2024

网上搜搜一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants