🔧 Fix all ruff typo errors & test CI/CD workflow (#109)

* [chore] Fix ruff typo

* [robot] Fix welcome robot
This commit is contained in:
OleehyO
2025-04-21 13:52:16 +08:00
committed by GitHub
parent ae776aa9c7
commit 511f69555c
9 changed files with 127 additions and 123 deletions

View File

@@ -41,7 +41,7 @@ def readimgs(image_paths: list[str]) -> list[np.ndarray]:
if image is None:
raise ValueError(f"Image at {path} could not be read.")
if image.dtype == np.uint16:
_logger.warning(f'Converting {path} to 8-bit, image may be lossy.')
_logger.warning(f"Converting {path} to 8-bit, image may be lossy.")
image = cv2.convertScaleAbs(image, alpha=(255.0 / 65535.0))
channels = 1 if len(image.shape) == 2 else image.shape[2]
@@ -112,7 +112,7 @@ def transform(images: List[Union[np.ndarray, Image.Image]]) -> List[torch.Tensor
assert IMG_CHANNELS == 1, "Only support grayscale images for now"
images = [
np.array(img.convert('RGB')) if isinstance(img, Image.Image) else img for img in images
np.array(img.convert("RGB")) if isinstance(img, Image.Image) else img for img in images
]
images = [trim_white_border(image) for image in images]
images = [general_transform_pipeline(image) for image in images]