From cff9b375fd24fa217eb849a3cdf2a3f006e17125 Mon Sep 17 00:00:00 2001 From: Ryo Kanbayashi Date: Thu, 24 Oct 2024 13:31:06 +0900 Subject: [PATCH] fixed opend image operation exeption. its cause was tensor operation after the code (2). --- colab_env/tagging.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/colab_env/tagging.py b/colab_env/tagging.py index bce9dd4..600a9cb 100644 --- a/colab_env/tagging.py +++ b/colab_env/tagging.py @@ -110,17 +110,6 @@ def prepare_image(self, image: Image.Image) -> Image.Image: padded_image: Image.Image = Image.new("RGB", (max_dim, max_dim), (255, 255, 255)) padded_image.paste(image, (pad_left, pad_top)) - # if max_dim != target_size: - # padded_image = padded_image.resize( - # (target_size, target_size), - # Image.BICUBIC, - # ) - - # image_array: np.ndarray = np.asarray(padded_image, dtype=np.float32) - # image_array = image_array[:, :, ::-1] - # - # return np.expand_dims(image_array, axis=0) - return padded_image def load_labels_hf(