From 7fcc0f3e85b89c896ca74fc7b3ea88783046ec80 Mon Sep 17 00:00:00 2001 From: limesqueezy Date: Thu, 4 Jan 2024 22:22:21 +0200 Subject: [PATCH] YoloReader never receives a 3rd positional argument (line 1560 of labelImg.py) even though it may be added in the CLI. It always defaults into appending classes.txt to the [IMAGE_PATH] --- labelImg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)