Detect missing first exercice

master
Sébastien Miquel 2026-04-01 22:22:19 +02:00
parent 95db769751
commit 822a531679
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ def prepare_image(image_path: str, bounding_boxes, all_labels, nb_pages):
label = bbox.get("label") label = bbox.get("label")
if label and label in all_labels: if label and label in all_labels:
current_index = all_labels.index(label) current_index = all_labels.index(label)
if current_index < last_label_index: if current_index < last_label_index or (last_label_index == -1 and current_index != 0):
color = "red" color = "red"
last_label_index = current_index last_label_index = current_index