Fix sorting when concatenating files

master
Sébastien Miquel 2026-01-18 15:03:08 +01:00
parent 6a0c1a3958
commit b49c78706b
1 changed files with 3 additions and 0 deletions

View File

@ -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