MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / __init__

Method __init__

core/dataset.py:12–33  ·  view source on GitHub ↗
(self, augmentation, shift_delta=4, image_shape=(96, 96))

Source from the content-addressed store, hash-verified

10 Thanks to Repo: https://github.com/mila-iqia/spr.git
11 """
12 def __init__(self, augmentation, shift_delta=4, image_shape=(96, 96)):
13 self.augmentation = augmentation
14
15 self.transforms = []
16 for aug in self.augmentation:
17 if aug == "affine":
18 transformation = RandomAffine(5, (.14, .14), (.9, 1.1), (-5, 5))
19 elif aug == "crop":
20 transformation = RandomCrop(image_shape)
21 elif aug == "rrc":
22 transformation = RandomResizedCrop((100, 100), (0.8, 1))
23 elif aug == "blur":
24 transformation = GaussianBlur2d((5, 5), (1.5, 1.5))
25 elif aug == "shift":
26 transformation = nn.Sequential(nn.ReplicationPad2d(shift_delta), RandomCrop(image_shape))
27 elif aug == "intensity":
28 transformation = Intensity(scale=0.05)
29 elif aug == "none":
30 transformation = nn.Identity()
31 else:
32 raise NotImplementedError()
33 self.transforms.append(transformation)
34
35 def apply_transforms(self, transforms, image):
36 for transform in transforms:

Callers

nothing calls this directly

Calls 2

IntensityClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected