Is it possible for the transformation below to cause any problem?
class RandomResizeCrop(object):

    def __init__(self, min_scale, max_scale, scale_step, output_size):

        self.scales = np.arange(min_scale, max_scale, scale_step)
        self.output_height, self.output_width = output_size

    def __call__(self, image, annotation):

        scale = np.random.choice(self.scales)
        
        image = cv2.resize(image, (0,0), fx=scale, fy=scale, interpolation=cv2.INTER_LINEAR)
        annotation = cv2.resize(annotation, (0,0), fx=scale, fy=scale, interpolation=cv2.INTER_NEAREST)

        input_height, input_width = image.shape[:2]

        row_pads = max(self.output_height - input_height, 0)
        col_pads = max(self.output_width - input_width, 0)

        top_pads = randint(0, row_pads)
        bot_pads = row_pads - top_pads

        left_pads = randint(0, col_pads)
        right_pads = col_pads - left_pads

        image = np.pad(image, ((top_pads,bot_pads),(left_pads,right_pads),(0,0)), mode='constant', constant_values=0)
        annotation = np.pad(annotation, ((top_pads,bot_pads),(left_pads,right_pads)), mode='constant', constant_values=255)

        y1 = randint(0, max(input_height - self.output_height, 0))
        y2 = y1 + self.output_height

        x1 = randint(0, max(input_width - self.output_width, 0))
        x2 = x1 + self.output_width

        return image[y1:y2,x1:x2], annotation[y1:y2,x1:x2]