Skip to content

Commit

Permalink
f strings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexriedel1 committed Jul 14, 2023
1 parent fc26f80 commit f651853
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/anomalib/data/utils/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ def get_transforms(
if "Resize" not in config.keys() and image_size is not None:
resize_height, resize_width = get_image_height_and_width(image_size)
transforms_list.append(A.Resize(height=resize_height, width=resize_width, always_apply=True))
logger.info("Resize {} added!".format((resize_height, resize_width)))
logger.info("Resize %s added!", (resize_height, resize_width))

for key, value in config.items():
if hasattr(A, key):
transform = getattr(A, key)(**value)
logger.info("Transform {} added!".format(transform))
logger.info("Transform %s added!", transform)
transforms_list.append(transform)
else:
raise ValueError("Transformation {} is not part of albumentations".format(key))
raise ValueError(f"Transformation {key} is not part of albumentations")

transforms_list.append(ToTensorV2())
transforms = A.Compose(transforms_list, additional_targets={"image": "image", "depth_image": "image"})
Expand Down

0 comments on commit f651853

Please sign in to comment.