From 598bd3975f0283c6cc3a22244ec55a68c318f4cb Mon Sep 17 00:00:00 2001 From: wubostc <913721086@qq.com> Date: Mon, 28 Nov 2022 20:58:44 +0800 Subject: [PATCH] Update labelImg.py --- labelImg.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/labelImg.py b/labelImg.py index efd8a2976..611e0d7c9 100755 --- a/labelImg.py +++ b/labelImg.py @@ -1637,6 +1637,12 @@ def load_yolo_txt_by_filename(self, txt_path): self.set_format(FORMAT_YOLO) t_yolo_parse_reader = YoloReader(txt_path, self.image) + self.label_hist = [] + for cls in t_yolo_parse_reader.classes: + self.label_hist.append(cls) + if len(self.label_hist) > 0: + self.label_dialog = LabelDialog( + parent=self, list_item=self.label_hist) shapes = t_yolo_parse_reader.get_shapes() print(shapes) self.load_labels(shapes)