From dcbfd93d7aeb14f8ff08a48866d2a68950d4c69a Mon Sep 17 00:00:00 2001 From: Maria Khalusova Date: Fri, 22 Sep 2023 10:29:27 -0400 Subject: [PATCH] [doc] fixed indices in obj detection example (#26343) fixed indexes in obj detection example --- docs/source/en/tasks/object_detection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/en/tasks/object_detection.md b/docs/source/en/tasks/object_detection.md index 563beb274253d5..7511ee66dd0b99 100644 --- a/docs/source/en/tasks/object_detection.md +++ b/docs/source/en/tasks/object_detection.md @@ -136,8 +136,8 @@ To get an even better understanding of the data, visualize an example in the dat >>> label2id = {v: k for k, v in id2label.items()} >>> for i in range(len(annotations["id"])): -... box = annotations["bbox"][i - 1] -... class_idx = annotations["category"][i - 1] +... box = annotations["bbox"][i] +... class_idx = annotations["category"][i] ... x, y, w, h = tuple(box) ... draw.rectangle((x, y, x + w, y + h), outline="red", width=1) ... draw.text((x, y), id2label[class_idx], fill="white")