Initial support for automatic fixing of additional and wrong label
This commit is contained in:
+2
-6
@@ -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 = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user