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.51k stars 6.27k forks source link

Ubuntu - not possible to create rectangle - application crash #885

Open vzeman opened 2 years ago

vzeman commented 2 years ago

Traceback:

  File "/home/vzeman/anaconda3/envs/py10/lib/python3.10/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, QLineF): argument 1 has unexpected type 'float'
  drawLine(self, QLine): argument 1 has unexpected type 'float'
  drawLine(self, int, int, int, int): argument 1 has unexpected type 'float'
  drawLine(self, QPoint, QPoint): argument 1 has unexpected type 'float'
  drawLine(self, Union[QPointF, QPoint], Union[QPointF, QPoint]): argument 1 has unexpected type 'float'
Aborted (core dumped)

Error occured, when I wanted to create rectangle and moved mouse over the image - application always crash

vzeman commented 2 years ago

Update: with python 3.8 is application not crashing

ropinheiro commented 2 years ago

I have this error with Python 3.10.4

AjibolaPy commented 2 years ago

i also have this error python 3.10

nine commented 2 years ago

Can not reproduce this bug on Debian GNU/Linux with following software versions:

~/src/labelImg (git)-[master] % python3 --version
Python 3.10.5

~/src/labelImg (git)-[master] % dpkg -l | grep "pyqt"
ii  pyqt5-dev-tools                                  5.15.6+dfsg-1+b2                    amd64        Development tools for PyQt5
ii  python3-pyqt5                                    5.15.6+dfsg-1+b2                    amd64        Python 3 bindings for Qt5
ii  python3-pyqt5.sip                                12.10.1-1                           amd64        runtime module for Python extensions using SIP
dvaupel commented 2 years ago

Same here. Ubuntu 22.04, installed with pip3.

The manual installation from the start page works.

Logiase commented 2 years ago

same error on Windows, installed with pip

Tylermarques commented 2 years ago

Same issue with me. Solution was to use python3.8 for me.

conda create -n labelImg python=3.8
pip3 install labelImg
python3 $HOME/miniconda3/envs/labelImg/bin/labelImg
dhanashreemhatre commented 2 years ago

i am having same problem pls someone help me to resolve it . Question 1) how can i downgrade the python version 3.10 to 3.9.?

windowshopr commented 2 years ago

same. Windows 10, python 3.10.5

windowshopr commented 2 years ago

https://github.com/heartexlabs/labelImg/issues/811#issuecomment-977605722

ptiszai commented 1 year ago

Solution. Error in Qt5. float to int conversion Changed: x:\xxxxx\python-310\Lib\site-packages\libs\canvas.py 526 line: default: p.drawRect(left_top.x(), left_top.y(), rect_width), int(rect_height) new: p.drawRect(int(left_top.x()), int(left_top.y()), int(rect_width), int(rect_height)) 530 line: default: p.drawLine( self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) new: p.drawLine( int(self.prev_point.x()), 0, int(self.prev_point.x()), int(self.pixmap.height())) 531 line: default: p.drawLine( 0, self.prev_point.y(), self.pixmap.width(), self.prev_point.y()) new: p.drawLine( 0, int(self.prev_point.y()), int(self.pixmap.width()), int(self.prev_point.y())) Changed: x:\xxxxx\python-310\Lib\site-packages\labelImg\labelImg.py 965 line: default: bar.setValue(bar.value() + bar.singleStep() units) new: bar.setValue(int(bar.value() + bar.singleStep() units))

Good work.

daudhiyaa commented 1 year ago

Please refer to this comment