diff --git a/plotting.py b/plotting.py index 35d52ab..7ce12b1 100644 --- a/plotting.py +++ b/plotting.py @@ -78,7 +78,7 @@ def prepare_image(image_path: str, bounding_boxes, all_labels, nb_pages): label = bbox.get("label") if label and label in all_labels: 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" last_label_index = current_index