Evezerest / PPOCRLabel

PPOCRLabel is a semi-automatic graphic annotation tool suitable for OCR field, with built-in PP-OCR model to automatically detect and re-recognize data. It is written in Python 3 and PyQT5, supporting rectangular box annotation and four-point annotation modes. Annotations can be directly used for the training of PP-OCR detection and recognition models.
175 stars 41 forks source link

Unexpected type 'float' when scrolling and trying to draw rectbox #54

Open enyung opened 1 year ago

enyung commented 1 year ago

When scrolling:

Traceback (most recent call last): File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\PPOCRLabel\PPOCRLabel.py", line 1425, in scrollRequest bar.setValue(bar.value() + bar.singleStep() * units) TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

When trying to draw RectBox:

Traceback (most recent call last): File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\PPOCRLabel\libs\canvas.py", line 596, in paintEvent p.drawRect(leftTop.x(), leftTop.y(), rectWidth, rectHeight) TypeError: arguments did not match any overloaded call: drawRect(self, rect: QRectF): argument 1 has unexpected type 'float' drawRect(self, x: int, y: int, w: int, h: int): argument 1 has unexpected type 'float' drawRect(self, r: QRect): argument 1 has unexpected type 'float'

xioahai778 commented 10 months ago

lines 597 p.drawRect(int(leftTop.x()), int(leftTop.y()), int(rectWidth), int(rectHeight))

EdwirdsLy commented 7 months ago

There is another error scrolling in any view [2023/11/17 10:41:44] ppocr WARNING: When args.layout is false, args.ocr is automatically set to false Traceback (most recent call last): File "F:\ProgramData\anaconda3\lib\site-packages\PPOCRLabel\PPOCRLabel.py", line 1425, in scrollRequest bar.setValue(bar.value() + bar.singleStep() * units) TypeError: setValue(self, int): argument 1 has unexpected type 'float'

RafiyatnSandya commented 2 months ago

Add int, bar.setValue(int(bar.value()) + (int(bar.singleStep()) * units)