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.8k stars 6.31k forks source link

TEMP FIX for index error when resume labeling #952

Open WOFGA opened 2 years ago

WOFGA commented 2 years ago

FIX: IndexError: list index out of range File "C:\Users\xxx\anaconda3\lib\site-packages\libs\yolo_io.py", line 125, in yolo_line_to_shape label = self.classes[int(class_index)] IndexError: list index out of range

i found that the program will not read classes.txt when started so there will be index error if we want to resume labeling, there are 2 place that we need to change:

  1. yolo_io.py: replace def save function def_save.txt

  2. yolo_io.py: replace def bnd_box_to_yolo_line function def_bnd_box_to_yolo_line.txt

######### "WOFGA" FIX labeling issue when restarting labeling ####### ######### "WOFGA" FIX labeling issue when restarting labeling ####### ######### "WOFGA" FIX labeling issue when restarting labeling #######

Akandesh commented 2 years ago

Have this issue too, applied the fix but still didn't work. Turns out my classes.txt was empty for some reason so manually adding the classes fixed the issue.

Edit: had some serious issues with classes. partially solved by having images and destination the same and having classes.txt there.