class
ImageClassification
extends
TransformsPresetImageClassification(crop_size: int, resize_size: int = 256, mean: tuple[float, ...] | None = None, std: tuple[float, ...] | None = None, interpolation: str | Interpolation = Interpolation.BILINEAR)Standard ImageNet classification inference preset.
Pipeline: SmallestMaxSize(resize_size) → CenterCrop(crop_size)
→ Normalize(mean, std). This is the torchvision /
Albumentations canonical eval pipeline shipped with most
pretrained image-classification weights.
Parameters
crop_sizeintSquare center-crop side fed to the model.
resize_sizeint= 256Shorter-side length before cropping.
meantuple of float= NonePer-channel normalization stats; default ImageNet.
stdtuple of float= NonePer-channel normalization stats; default ImageNet.
Resize interpolation mode.
Notes
Input is assumed already scaled to [0, 1] (prepend
lucid.utils.transforms.ToFloat for uint8).
Used by 1
Constructors
1dunder
__init__
→None__init__(crop_size: int, resize_size: int = 256, mean: tuple[float, ...] | None = None, std: tuple[float, ...] | None = None, interpolation: str | Interpolation = Interpolation.BILINEAR)Initialise the module and validate the supplied config.
Parameters
configModelConfigMust be an instance of the subclass's declared
config_class.Raises
TypeErrorIf
config_class has not been set on the concrete subclass,
or if config is not an instance of config_class.