def METHOD_NAME(self, size, *args, **kwargs):
    ratios = tuple(float(s) / float(s_orig) for s, s_orig in zip(size, self.size))
    ratio_w, ratio_h = ratios
    resized_data = self.keypoints.clone()
    resized_data[..., 0] *= ratio_w
    resized_data[..., 1] *= ratio_h
    keypoints = type(self)(resized_data, size, self.mode)
    for k, v in self.extra_fields.items():
        keypoints.add_field(k, v)
    return keypoints