MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / PedAttrAugmentation

Class PedAttrAugmentation

PATH/core/data/transforms/pedattr_transforms.py:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import torch
10
11class PedAttrAugmentation(object):
12 def __init__(self, height, width):
13 normalize = T.Normalize(mean=[0, 0, 0], std=[1, 1, 1])
14 train_transform = T.Compose([
15 T.Resize((height, width)),
16 T.Pad(10),
17 T.RandomCrop((height, width)),
18 T.RandomHorizontalFlip(),
19 T.PILToTensor(),
20 ])
21
22 self.transform = train_transform
23
24 def __call__(self, img):
25 return self.transform(img)
26
27class PedAttrTestAugmentation(object):
28 def __init__(self, height, width):

Callers 3

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected