From 8c76fcbc3b79d5d9bae6c31151f65e194896dcca Mon Sep 17 00:00:00 2001 From: alexeykozhevin Date: Wed, 27 Nov 2024 07:52:00 +0000 Subject: [PATCH 1/2] Fix scale in ImagesBatch --- batchflow/batch_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batchflow/batch_image.py b/batchflow/batch_image.py index 9308f17b2..98ad02ac1 100644 --- a/batchflow/batch_image.py +++ b/batchflow/batch_image.py @@ -350,7 +350,7 @@ def _calc_origin(self, image_shape, origin, background_shape): return np.asarray(origin, dtype=np.int64) @apply_parallel - def scale(self, image, factor, preserve_shape=False, origin='center', resample=0): + def scale(self, image, factor, preserve_shape=False, origin='center', resample=0, src=None, dst=None): """ Scale the content of each image in the batch. Resulting shape is obtained as original_shape * factor. From a551d66a5f317b6f0b8c35a996d6a6fb9c21899c Mon Sep 17 00:00:00 2001 From: alexeykozhevin Date: Wed, 27 Nov 2024 08:22:17 +0000 Subject: [PATCH 2/2] Fix pylint --- batchflow/batch_image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/batchflow/batch_image.py b/batchflow/batch_image.py index 98ad02ac1..67dd40dbf 100644 --- a/batchflow/batch_image.py +++ b/batchflow/batch_image.py @@ -409,6 +409,8 @@ def scale(self, image, factor, preserve_shape=False, origin='center', resample=0 ------- self """ + _ = src, dst + original_shape = self._get_image_shape(image) rescaled_shape = list(np.int32(np.ceil(np.asarray(original_shape)*factor))) rescaled_image = image.resize(rescaled_shape, resample=resample)