-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata2.py
40 lines (35 loc) · 1.35 KB
/
data2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from torchvision.transforms import transforms
class TrainTransforms(object):
def __init__(self):
self.transforms = transforms.Compose(
[ #Noaugmentations please
# transforms.ToTensor(),
# transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
transforms.Resize((320,320)),
]
)
def __call__(self, input, *args, **kwargs):
return self.transforms(input)
class DinoTransforms(object):
def __init__(self):
self.transforms = transforms.Compose(
[ #Noaugmentations please
transforms.ToTensor(),
# rescale between -1 and 1
transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
transforms.CenterCrop((320,320)),
]
)
class DinoValTransforms(object):
def __init__(self):
self.transforms = transforms.Compose(
[ #Noaugmentations please
transforms.ToTensor(),
# rescale between -1 and 1
transforms.Resize((320,320)),
transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
transforms.CenterCrop((320,320)),
]
)
def __call__(self, input, *args, **kwargs):
return self.transforms(input)