Skip to content
Snippets Groups Projects
Commit a3febdc4 authored by André Anjos's avatar André Anjos :speech_balloon: Committed by Daniel CARRON
Browse files

[tests.test_tbx11k] Fix test after bounding-box type fix

parent f0e1e38e
No related branches found
No related tags found
1 merge request!12Adds grad-cam support on classifiers
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment