I installed labelImg on windows 10 with pip install labelimg
and tried using the Create RectBox tool, which caused it to crash:
Traceback (most recent call last):
File "C:\Users...", 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'
I have tired this with python 3.7 and 3.10 with the same result.
I have also tried downloading the code directly from https://github.com/tzutalin/labelImg, but there are all sorts of errors
> python labelImg.py
Traceback (most recent call last):
File "C:\Users...\labelImg.py", line 29, in <module>
from libs.resources import *
ModuleNotFoundError: No module named 'libs.resources'
(There is a libs
folder, but no file named resources
under it)
After commenting out this import line, I got an assertion error:
...... line 47, in get_string
assert(string_id in self.id_to_message), "Missing string id : " + string_id
AssertionError: Missing string id : useDefaultLabel
Is there a version that works?
I am a beginner coder. I am gonna get straight to the point how to fix the bug above. Simply get to the file of your path "File "C:\Users...", line 530, in paintEvent...". You will open file named "canvas.py". Replace all the codes in your recent file (I recommend you should have a copy of everything you change, just for back-up if everything is going too far) with the codes below:
canvas.py
End of code
Hope it help!