Initial support for automatic fixing of additional and wrong label

This commit is contained in:
2026-03-15 22:28:15 +01:00
parent 5f1613b8c1
commit f43c296e8a
11 changed files with 292 additions and 61 deletions
+2 -6
View File
@@ -283,9 +283,7 @@ class ImageViewer:
self.root.clipboard_clear()
self.root.clipboard_append(box_str)
def natural_key(text):
return [int(c) if c.isdigit() else c.lower() for c in re.split(r'(\d+)', str(text))]
from utils import natural_key, read_all_labels
if __name__ == "__main__":
if len(sys.argv) < 2:
@@ -319,9 +317,7 @@ if __name__ == "__main__":
files_to_process = sorted(cutleft_dir.glob("*.jpg"))
try:
all_labels = sorted(list(filter(None,
(base_dir / "labels").read_text().splitlines())),
key = natural_key)
all_labels = read_all_labels(base_dir)
except FileNotFoundError:
all_labels = []