diff --git a/labelImg.py b/labelImg.py index efd8a2976..9277ce20f 100755 --- a/labelImg.py +++ b/labelImg.py @@ -109,6 +109,7 @@ def __init__(self, default_filename=None, default_prefdef_class_file=None, defau # Load predefined classes to the list self.load_predefined_classes(default_prefdef_class_file) + self.default_prefdef_class_file = default_prefdef_class_file if self.label_hist: self.default_label = self.label_hist[0] @@ -1636,7 +1637,7 @@ def load_yolo_txt_by_filename(self, txt_path): return self.set_format(FORMAT_YOLO) - t_yolo_parse_reader = YoloReader(txt_path, self.image) + t_yolo_parse_reader = YoloReader(txt_path, self.image, self.default_prefdef_class_file) shapes = t_yolo_parse_reader.get_shapes() print(shapes) self.load_labels(shapes)