Augment the mask of the cell size by dilating the size of the cell with random kernel
(x)
| 21 | |
| 22 | |
| 23 | def cell_shape_aug(x): |
| 24 | """ |
| 25 | Augment the mask of the cell size by dilating the size of the cell with random kernel |
| 26 | """ |
| 27 | if np.random.random() < 0.5: |
| 28 | cell_mask = x[:, :, -1] |
| 29 | kernel_size = np.random.choice([2, 3, 5]) |
| 30 | kernel = np.ones(kernel_size, np.uint8) |
| 31 | img_dilation = cv2.dilate(cell_mask, kernel, iterations=1) |
| 32 | x[:, :, -1] = img_dilation |
| 33 | return x |
| 34 | |
| 35 | |
| 36 | def env_shape_aug(x): |
nothing calls this directly
no outgoing calls
no test coverage detected