Skip to content
Snippets Groups Projects

Make square centre-padding a model transform

Merged André Anjos requested to merge issue-23-and-39 into main
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -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()
Loading