Skip to content

Commit

Permalink
Coerce torch resize's size type to int
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Milk committed Dec 5, 2023
1 parent eb54029 commit 2f84b3f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lazyslide/loader/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2f84b3f

Please sign in to comment.