MCPcopy Create free account
hub / github.com/ZhengdiYu/SignAvatars / augmentation

Function augmentation

common/utils/preprocessing.py:101–109  ·  view source on GitHub ↗
(img, bbox, data_split)

Source from the content-addressed store, hash-verified

99
100
101def augmentation(img, bbox, data_split):
102 if data_split == 'train':
103 scale, rot, color_scale, do_flip = get_aug_config()
104 else:
105 scale, rot, color_scale, do_flip = 1.0, 0.0, np.array([1, 1, 1]), False
106
107 img, trans, inv_trans = generate_patch_image(img, bbox, scale, rot, do_flip, cfg.input_img_shape)
108 img = np.clip(img * color_scale[None, None, :], 0, 255)
109 return img, trans, inv_trans, rot, do_flip
110
111
112def generate_patch_image(cvimg, bbox, scale, rot, do_flip, out_shape):

Callers

nothing calls this directly

Calls 2

get_aug_configFunction · 0.85
generate_patch_imageFunction · 0.85

Tested by

no test coverage detected