Skip to content
Snippets Groups Projects
Commit f6342125 authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[engine.saliency.viewer] Fix --show-groundtruth

parent 53c39706
No related branches found
No related tags found
2 merge requests!18Update tests,!16Make square centre-padding a model transform
Pipeline #84291 canceled
......@@ -226,6 +226,7 @@ def run(
for sample in tqdm(
dataset_loader, desc="batches", leave=False, disable=None
):
# WARNING: following code assumes a batch size of 1. Will break if not the case.
name = str(sample[1]["name"][0])
label = int(sample[1]["label"].item())
data = sample[0][0]
......@@ -243,7 +244,9 @@ def run(
# regions of interest. We need to abstract from this to support more
# datasets and other ways to annotate.
if show_groundtruth:
ground_truth = sample[1].get("bounding_boxes", BoundingBoxes())
ground_truth = sample[1].get("bounding_boxes", BoundingBoxes())[
0
]
else:
ground_truth = BoundingBoxes()
......
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