From a3febdc4286476127f4137c5e2385abe513d66b0 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Mon, 30 Oct 2023 18:43:54 -0300
Subject: [PATCH] [tests.test_tbx11k] Fix test after bounding-box type fix

---
 tests/test_tbx11k.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/test_tbx11k.py b/tests/test_tbx11k.py
index a4c31edb..e7dae567 100644
--- a/tests/test_tbx11k.py
+++ b/tests/test_tbx11k.py
@@ -193,19 +193,19 @@ def check_loaded_batch(
     ):
         # there must be a sign indicated on the image, if active TB is detected
         if label == 1:
-            assert len(bboxes[0]) != 0
+            assert len(bboxes) != 0
 
         # eif label == 0:  # not true, may have TBI!
         #    assert len(bboxes) == 0
 
         # asserts all bounding boxes are within the raw image width and height
-        for bbox_label, xmin, ymin, width, height in zip(*bboxes):
+        for bbox in bboxes:
             if label == 1:
-                assert bbox_label == 1
+                assert bbox.label == 1
             else:
-                assert bbox_label == 0
-            assert (xmin + width) < sample.shape[2]
-            assert (ymin + height) < sample.shape[1]
+                assert bbox.label == 0
+            assert bbox.xmax < sample.shape[2]
+            assert bbox.ymax < sample.shape[1]
 
     # use the code below to view generated images
     # from torchvision.transforms.functional import to_pil_image
-- 
GitLab