def inverse_op(self, input_image, mask=None):
if not isinstance(input_image, dict):
full_border = match_ndim(self.border, input_image.ndim)
outputs = _crop_numpy_array(input_image, full_border)
return outputs, mask
for name, image in input_image.items():
if name not in self.image_name:
continue
full_border = match_ndim(self.border, image.ndim)input_image[name] = _crop_numpy_array(image, full_border)
return input_image, mask
After Change
input_image[name] = np.pad(image, self.full_border, mode=self.mode)
return input_image, mask
def inverse_op(self, input_image, mask=None):
if not isinstance(input_image, dict):
// you can run the cropping op without running the padding op, but only if you
// pad with a constant amount (not pad_to)
if self.full_border is None and self.pad_to == (0,):
self._set_full_border(input_image)
outputs = self._crop_numpy_array(input_image, self.full_border)
return outputs, mask
for name, image in input_image.items():
// you can run the cropping op without running the padding op, but only if you
// pad with a constant amount (not pad_to)
if self.full_border is None and self.pad_to == (0,):
self._set_full_border(image)
if name not in self.image_name:
continue
input_image[name] = self._crop_numpy_array(image, self.full_border)