PhysAugNet 1.0.1
VQ-VQE powered augmentation for metal defect segmentation
Loading...
Searching...
No Matches
thermal.py
Go to the documentation of this file.
1from PIL import Image
2import torchvision.transforms as T
3import random
4from torchvision.transforms import functional as TF
5
7 if not isinstance(image, Image.Image):
8 image = TF.to_pil_image(image)
9 img = T.ColorJitter(contrast=(0.8, 1.2), hue=(-0.1, 0.1))(image)
10 if random.random() < 0.5:
11 img = img.filter(ImageFilter.GaussianBlur(radius=1.0))
12 return TF.to_tensor(img)
apply_thermal_augmentation(image)
Definition thermal.py:6