| 29 | |
| 30 | |
| 31 | class StaticRandomCrop(object): |
| 32 | def __init__(self, image_size, crop_size): |
| 33 | self.th, self.tw = crop_size |
| 34 | h, w = image_size |
| 35 | self.h1 = random.randint(0, h - self.th) |
| 36 | self.w1 = random.randint(0, w - self.tw) |
| 37 | |
| 38 | def __call__(self, img): |
| 39 | return img[self.h1:(self.h1 + self.th), self.w1:(self.w1 + self.tw), :] |
| 40 | |
| 41 | |
| 42 | class StaticCenterCrop(object): |
no outgoing calls
no test coverage detected