Randomly crop a box of shape (h, w), sampled from [min, max] (both inclusive). If max is None, will use the input image shape. Args: wmin, hmin, wmax, hmax: range to sample shape. max_aspect_ratio (float): this argument has no effect and is deprecate
(self, wmin, hmin,
wmax=None, hmax=None,
max_aspect_ratio=None)
| 62 | """ Random crop with a random shape""" |
| 63 | |
| 64 | def __init__(self, wmin, hmin, |
| 65 | wmax=None, hmax=None, |
| 66 | max_aspect_ratio=None): |
| 67 | """ |
| 68 | Randomly crop a box of shape (h, w), sampled from [min, max] (both inclusive). |
| 69 | If max is None, will use the input image shape. |
| 70 | |
| 71 | Args: |
| 72 | wmin, hmin, wmax, hmax: range to sample shape. |
| 73 | max_aspect_ratio (float): this argument has no effect and is deprecated. |
| 74 | """ |
| 75 | super(RandomCropRandomShape, self).__init__() |
| 76 | if max_aspect_ratio is not None: |
| 77 | log_deprecated("RandomCropRandomShape(max_aspect_ratio)", "It is never implemented!", "2020-06-06") |
| 78 | self._init(locals()) |
| 79 | |
| 80 | def get_transform(self, img): |
| 81 | hmax = self.hmax or img.shape[0] |
nothing calls this directly
no test coverage detected