From b49c78706bb22f3be95cede6365f77da237ad32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Sun, 18 Jan 2026 15:03:08 +0100 Subject: [PATCH] Fix sorting when concatenating files --- annotating.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/annotating.py b/annotating.py index 2e88cb9..709b53a 100644 --- a/annotating.py +++ b/annotating.py @@ -204,6 +204,7 @@ def process_correction(root_dir, data, all_labels): margin_left = 200 for student_id, labels in data.items(): + # Prepare output directory: Dir/Anot_CopieID 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" ]) + images.sort(key=lambda f: [int(n) for n in re.findall(r'\d+', f)]) + if not images: continue