(self, img)
| 36 | self.xx = np.reshape(xx * self.grid_size, (n_grid * n_grid,)) |
| 37 | |
| 38 | def __call__(self, img): |
| 39 | r_x = np.random.randint(0, self.side + 1, self.n_grid * self.n_grid) |
| 40 | r_y = np.random.randint(0, self.side + 1, self.n_grid * self.n_grid) |
| 41 | img = np.asarray(img, np.uint8) |
| 42 | crops = [] |
| 43 | for i in range(self.n_grid * self.n_grid): |
| 44 | crops.append(img[self.xx[i] + r_x[i]: self.xx[i] + r_x[i] + self.crop_size, |
| 45 | self.yy[i] + r_y[i]: self.yy[i] + r_y[i] + self.crop_size, :]) |
| 46 | crops = [Image.fromarray(crop) for crop in crops] |
| 47 | return crops |
| 48 | |
| 49 | |
| 50 | class Rotate(object): |
nothing calls this directly
no outgoing calls
no test coverage detected