Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Added check for none roi, as the if statement is redundant otherwise (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
moerlemans authored Nov 24, 2023
1 parent 58a200c commit 15553f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ahcore/transforms/pre_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def __call__(self, sample: DlupDatasetSample) -> dict[str, DlupDatasetSample]:
mask = mask[np.newaxis, ...]
sample["target"] = torch.from_numpy(mask).float()

if "roi" in sample["annotation_data"]:
if "roi" in sample["annotation_data"] and sample["annotation_data"]["roi"] is not None:
roi = sample["annotation_data"]["roi"]
sample["roi"] = torch.from_numpy(roi[np.newaxis, ...]).float()

Expand Down

0 comments on commit 15553f5

Please sign in to comment.