(self,x)
| 50 | return [F.pad(x, self._pad, mode='constant', value=0.0) for x in inputs] |
| 51 | |
| 52 | def unpad(self,x): |
| 53 | ht, wd = x.shape[-2:] |
| 54 | c = [self._pad[2], ht-self._pad[3], self._pad[0], wd-self._pad[1]] |
| 55 | return x[..., c[0]:c[1], c[2]:c[3]] |
| 56 | |
| 57 | def compute_grid_indices(image_shape, patch_size=TRAIN_SIZE, min_overlap=20): |
| 58 | if min_overlap >= patch_size[0] or min_overlap >= patch_size[1]: |
no outgoing calls
no test coverage detected