MCPcopy Create free account
hub / github.com/MotrixLab/ADHMR / get_aug_config

Function get_aug_config

HMR-Scorer/common/utils/preprocessing.py:89–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87
88
89def get_aug_config():
90 scale_factor = 0.25
91 rot_factor = 30
92 color_factor = 0.2
93
94 scale = np.clip(np.random.randn(), -1.0, 1.0) * scale_factor + 1.0
95 rot = np.clip(np.random.randn(), -2.0,
96 2.0) * rot_factor if random.random() <= 0.6 else 0
97 c_up = 1.0 + color_factor
98 c_low = 1.0 - color_factor
99 color_scale = np.array([random.uniform(c_low, c_up), random.uniform(c_low, c_up), random.uniform(c_low, c_up)])
100 do_flip = random.random() <= 0.5
101
102 return scale, rot, color_scale, do_flip
103
104
105def augmentation(img, bbox, data_split):

Callers 2

augmentationFunction · 0.70
augmentation_segFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected