PhysAugNet
1.0.1
VQ-VQE powered augmentation for metal defect segmentation
Loading...
Searching...
No Matches
grain.py
Go to the documentation of this file.
1
import
torch
2
3
def
add_grain
(image, intensity=0.05):
4
if
not
torch.is_tensor(image):
5
image = torch.tensor(image)
6
noise = torch.randn_like(image) * intensity
7
return
torch.clamp(image + noise, 0, 1)
grain.add_grain
add_grain(image, intensity=0.05)
Definition
grain.py:3
physaug
augment
grain.py
Generated by
1.14.0