From 2f84b3ffe818062ca170ca420cc0bdc73c218eed Mon Sep 17 00:00:00 2001 From: Mr-Milk Date: Tue, 5 Dec 2023 16:23:40 +0100 Subject: [PATCH] Coerce torch resize's size type to int --- lazyslide/loader/dataset.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lazyslide/loader/dataset.py b/lazyslide/loader/dataset.py index 977127f..6b1c159 100644 --- a/lazyslide/loader/dataset.py +++ b/lazyslide/loader/dataset.py @@ -6,13 +6,6 @@ from lazyslide.normalizer import ColorNormalizer -def get_dest_size(size): - if isinstance(size, Number): - return size, size - else: - return size - - def compose_transform(resize=None, color_normalize=None, feature_extraction=False, @@ -49,9 +42,9 @@ def __init__(self, self.transform = transform else: if resize is not None: - resize_to = get_dest_size(resize) + resize_to = resize elif self.tile_ops.downsample != 1: - resize_to = (self.tile_ops.height, self.tile_ops.width) + resize_to = (int(self.tile_ops.height), int(self.tile_ops.width)) else: resize_to = None self.transform = compose_transform(resize=resize_to,