Exemple #1
0
 def _apply_mask(self, mask):
     x, y, w, h = self._coord_info
     cropped_mask = mask[y:y + h, x:x + w]
     return F.resize(cropped_mask, self.output_size, cv2.INTER_NEAREST)
Exemple #2
0
 def _apply_mask(self, mask):
     h, w, th, tw = self._shape_info
     if h == th and w == tw:
         return mask
     return F.resize(mask, (th, tw), cv2.INTER_NEAREST)
Exemple #3
0
 def _apply_image(self, image):
     x, y, w, h = self._coord_info
     cropped_img = image[y:y + h, x:x + w]
     return F.resize(cropped_img, self.output_size, self.interpolation)
Exemple #4
0
 def _apply_image(self, image):
     h, w, th, tw = self._shape_info
     if h == th and w == tw:
         return image
     return F.resize(image, (th, tw), self.interpolation)