(img, bbox, data_split)
| 99 | |
| 100 | |
| 101 | def 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 | |
| 112 | def generate_patch_image(cvimg, bbox, scale, rot, do_flip, out_shape): |
nothing calls this directly
no test coverage detected