Fix sorting when concatenating files
parent
6a0c1a3958
commit
b49c78706b
|
|
@ -204,6 +204,7 @@ def process_correction(root_dir, data, all_labels):
|
||||||
margin_left = 200
|
margin_left = 200
|
||||||
|
|
||||||
for student_id, labels in data.items():
|
for student_id, labels in data.items():
|
||||||
|
|
||||||
# Prepare output directory: Dir/Anot_CopieID
|
# Prepare output directory: Dir/Anot_CopieID
|
||||||
output_dir = os.path.join(root_dir, f"Anot_Copie{student_id}")
|
output_dir = os.path.join(root_dir, f"Anot_Copie{student_id}")
|
||||||
|
|
||||||
|
|
@ -412,6 +413,8 @@ def concat_anot_images(directory):
|
||||||
if f.name != "Concat.jpg"
|
if f.name != "Concat.jpg"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
images.sort(key=lambda f: [int(n) for n in re.findall(r'\d+', f)])
|
||||||
|
|
||||||
if not images:
|
if not images:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue