import albumentations as A import inspect from typing import Callable FILTER_TRANSFORMS = [ A.ImageOnlyTransform, A.DualTransform, A.TemplateTransform, A.Lambda, ] def is_not_supported_transform(transform_cls): sig = inspect.signature(transform_cls) for filter_transform_cls in FILTER_TRANSFORMS: if transform_cls is filter_transform_cls: return True for param in sig.parameters.values(): if issubclass(type(param.annotation), type(Callable)): return True if param.name in ["read_fn", "reference_images"]: return True return False