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

Function augmentation

HMR-Scorer/common/utils/preprocessing.py:105–116  ·  view source on GitHub ↗
(img, bbox, data_split)

Source from the content-addressed store, hash-verified

103
104
105def augmentation(img, bbox, data_split):
106 if getattr(cfg, 'no_aug', False):
107 scale, rot, color_scale, do_flip = 1.0, 0.0, np.array([1, 1, 1]), False
108 elif data_split == 'train':
109 scale, rot, color_scale, do_flip = get_aug_config()
110 else:
111 scale, rot, color_scale, do_flip = 1.0, 0.0, np.array([1, 1, 1]), False
112
113 img, trans, inv_trans = generate_patch_image(img, bbox, scale, rot, do_flip, cfg.input_img_shape)
114 focal_scale = cfg.input_img_shape[1] / (bbox[2] * scale)
115 img = np.clip(img * color_scale[None, None, :], 0, 255)
116 return img, trans, inv_trans, rot, do_flip, focal_scale
117
118
119def augmentation_seg(img, seg_img, bbox, data_split):

Callers 7

__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90

Calls 2

get_aug_configFunction · 0.70
generate_patch_imageFunction · 0.70

Tested by 1

__getitem__Method · 0.72