HumanSignal/labelImg

labelImg crashing when scrolling (Windows, Python 3.10)

pedro-sa1 opened this issue · 0 comments

On Pytthon >= 3.10 there are a few problems already known by the community that makes labbeImg crash when using it. I've looked this specific one but couldn't find anything related, so I'm posting the work-around I've found to solve the crashes when scrolling the image.

ERROR:

QMimeDatabase: Error loading internal MIME data
An error has been encountered at line 1 of : Premature end of document.:
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\anaconda3\lib\site-packages\labelImg\labelImg.py", line 1014, in zoom_request
self.add_zoom(scale * units)
File "C:\Users\xxx\AppData\Local\anaconda3\lib\site-packages\labelImg\labelImg.py", line 974, in add_zoom
self.set_zoom(self.zoom_widget.value() + increment)
File "C:\Users\xxx\AppData\Local\anaconda3\lib\site-packages\labelImg\labelImg.py", line 971, in set_zoom
self.zoom_widget.setValue(value)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'

On file C:\Users\xxxx\AppData\Local\anaconda3\Lib\site-packages\labelImg.py:

Line 971:
from: self.zoom_widget.setValue(value)
to: self.zoom_widget.setValue(int(value))

Line 1025
from: h_bar.setValue(new_h_bar_value)
to: h_bar.setValue(int(new_h_bar_value))

Line 1026:
from: v_bar.setValue(new_v_bar_value)
to: v_bar.setValue(int(new_v_bar_value))