From eb112783e6ebfb063fd73440af8ae5e3c06a95bd Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Wed, 2 Aug 2023 21:26:53 +0200 Subject: [PATCH] [data.image_utils] Remove unused code --- src/ptbench/data/image_utils.py | 69 --------------------------------- 1 file changed, 69 deletions(-) diff --git a/src/ptbench/data/image_utils.py b/src/ptbench/data/image_utils.py index 99df51c8..3dce9cd2 100644 --- a/src/ptbench/data/image_utils.py +++ b/src/ptbench/data/image_utils.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later """Data loading code.""" -import pathlib - import numpy import PIL.Image @@ -47,70 +45,3 @@ def remove_black_borders( else: raise NotImplementedError - - -class RemoveBlackBorders: - """Remove black borders of CXR.""" - - def __init__(self, threshold=0): - self.threshold = threshold - - def __call__(self, img): - return remove_black_borders(img, self.threshold) - - -def load_pil(path: str | pathlib.Path) -> PIL.Image.Image: - """Loads a sample data. - - Parameters - ---------- - - path - The full path leading to the image to be loaded - - - Returns - ------- - - image - A PIL image - """ - return PIL.Image.open(path) - - -def load_pil_grayscale(path: str | pathlib.Path) -> PIL.Image.Image: - """Loads a sample data in grayscale mode ("L"). - - Parameters - ---------- - - path - The full path leading to the image to be loaded - - - Returns - ------- - - image - A PIL image in grayscale mode - """ - return load_pil(path).convert("L") - - -def load_pil_rgb(path: str | pathlib.Path) -> PIL.Image.Image: - """Loads a sample data in RGB mode ("RGB"). - - Parameters - ---------- - - path - The full path leading to the image to be loaded - - - Returns - ------- - - image - A PIL image in RGB mode - """ - return load_pil(path).convert("RGB") -- GitLab