import torch
from torchvision.transforms import v2
from torchvision import models

# Square crop: scale is a fraction of ORIGINAL IMAGE AREA.
train_transforms = v2.Compose([
    v2.RandomResizedCrop((224, 224), scale=(0.78, 1.0), ratio=(1.0, 1.0), antialias=True),
    v2.RandomHorizontalFlip(p=0.50),
    v2.RandomRotation(degrees=18, fill=244),
    v2.ColorJitter(brightness=0.18, contrast=0.16, saturation=0.12),
    v2.ToImage(),
    v2.ToDtype(torch.float32, scale=True),
    v2.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])
# Deterministic validation preprocessing for these pretrained weights.
validation_transforms = models.ResNet18_Weights.DEFAULT.transforms()
# Split ORIGINAL observations first; augment only the training split.
# Fresh random variants are sampled when training examples are accessed.
# Browser interpolation/colour rendering differs from torchvision.
