wkentaro / labelme

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).
https://labelme.io
Other
13.59k stars 3.42k forks source link

Application crashes in Ubuntu 22.04 #1371

Open jesstytam opened 11 months ago

jesstytam commented 11 months ago

Provide environment information

/home/user/mambaforge/bin/python Python 3.10.10

What OS are you using?

Ubuntu 22.04

Describe the Bug

I ran sudo apt-get install labelme to install the application and then ran labelme to open it, but after a few seconds of opening the app, it crashed.

Here is the error from the terminal:

[INFO   ] __init__:get_config:70 - Loading config file from: /home/user/.labelmerc
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 618, in paintEvent
    p.translate(self.offsetToCenter())
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 659, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(int, int): argument 1 has unexpected type 'float'
  QPoint(QPoint): argument 1 has unexpected type 'float'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_labelme.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 618, in paintEvent
    p.translate(self.offsetToCenter())
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 659, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(int, int): argument 1 has unexpected type 'float'
  QPoint(QPoint): 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: Painter already active
Segmentation fault (core dumped)

Expected Behavior

No response

To Reproduce

No response

step305 commented 11 months ago

Line 830 in [labelme/widgets/canvas.py]

from

return QtCore.QPointF(x, y)

change to

return QtCore.QPointF(int(x), int(y))

sc0v0ne commented 11 months ago

@jesstytam Good afternoon, use the brew tool, because I had the same problem. I used brew to install and it was successful.

brew install pyqt  # maybe pyqt5
brew install wkentaro/labelme/labelme  # command line interface

# brew install --cask wkentaro/labelme/labelme  # app

# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases