HumanSignal / labelImg

LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Label Studio, the open source data labeling tool for images, text, hypertext, audio, video and time-series data.
https://youtu.be/p0nR2YsCY_U
MIT License
22.15k stars 6.23k forks source link

unexpected type 'float' #1011

Closed Chanpoe closed 10 months ago

Chanpoe commented 10 months ago

Install labelImg through pip. When the folder is opened and labeled with data, it will flash back with an error as follows: TraceBack:

C:\Users\Chanpoe>labelImg
Traceback (most recent call last):
  File "C:\Users\Chanpoe\AppData\Local\Programs\Python\Python311\Lib\site-packages\libs\canvas.py", line 530, in paintEvent
    p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height())
TypeError: arguments did not match any overloaded call:
  drawLine(self, l: QLineF): argument 1 has unexpected type 'float'
  drawLine(self, line: QLine): argument 1 has unexpected type 'float'
  drawLine(self, x1: int, y1: int, x2: int, y2: int): argument 1 has unexpected type 'float'
  drawLine(self, p1: QPoint, p2: QPoint): argument 1 has unexpected type 'float'
  drawLine(self, p1: Union[QPointF, QPoint], p2: Union[QPointF, QPoint]): argument 1 has unexpected type 'float'
StillOnIt commented 10 months ago

I have the same problem

zahir2000 commented 10 months ago

Try a lower version of Python, like Python 3.7.2

zahir2000 commented 10 months ago

If you want to keep using your Python version, navigate to the C:\Users\Chanpoe\AppData\Local\Programs\Python\Python311\Lib\site-packages\libs\canvas.py

line 530 wrap the self.prev_point.x() with int()

Chanpoe commented 10 months ago

I can successfully run and label the data by using this packaged exe file: https://github.com/tzutalin/labelImg/files/2638199/windows_v1.8.1.zip