robot-perception-group / smarter-labelme

Video / Image Annotation (Polygon, Semantic mask, Classification) with Python and Re3
GNU General Public License v3.0
16 stars 3 forks source link

Crashes with `argument 1 has unexpected type 'float'` #3

Open simbamangu opened 7 months ago

simbamangu commented 7 months ago

Have tried this with MacOS Sonoma 14.4, both Python 3.10 and 3.11 with same error.

Steps:

mv ~/.labelmerc ~/.labelmerc_bkp # remove old labelme config
mkvirtualenv smarterlabelme -p 3.10 # create an environment
pip install --upgrade pip
pip install PyYAML # not indicated as requirement in readme
pip install PyQt5
python3 -m pip install --upgrade "git+https://github.com/robot-perception-group/smarter-labelme@master"

Error:

Traceback (most recent call last):
  File "/Users/.../.virtualenvs/smartlabelme/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 632, in paintEvent
    p.translate(self.offsetToCenter())
  File "/Users/.../.virtualenvs/smartlabelme/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 691, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(xpos: int, ypos: int): argument 1 has unexpected type 'float'
  QPoint(a0: QPoint): argument 1 has unexpected type 'float'
[1]    54615 abort      smarter_labelme
jorgegalinmor commented 5 months ago

I've had the same error, apparently its due to a mismatch with the Qt version, I solved it locally casting the types inputed to QPoint, like so: "QPoint(int(x), int(y))", but I think it should be solvable also changing Qpoint with QpointF. You might need to do this in several other locations.