(self, image, output_size, is_training, rng)
| 374 | return image |
| 375 | |
| 376 | def resize_image(self, image, output_size, is_training, rng): |
| 377 | if self.resize == "siglip": |
| 378 | crop_arr, mask_arr = siglip_resize_and_pad(image, output_size, float32=not self.normalize_on_gpu) |
| 379 | elif self.resize == "dino": |
| 380 | crop_arr, mask_arr = dino_resize_and_pad(image, output_size) |
| 381 | elif self.resize == "metaclip": |
| 382 | crop_arr, mask_arr = metaclip_resize(image, output_size) |
| 383 | else: |
| 384 | resize = "torch-bilinear" if self.resize == "default" else self.resize |
| 385 | crop_arr, mask_arr = resize_and_pad( |
| 386 | image, output_size, pad_value=self.pad_value, rng=rng, is_training=is_training, |
| 387 | resize_method=resize) |
| 388 | return crop_arr, mask_arr |
| 389 | |
| 390 | def build_single_crop(self, image, is_training, rng, image_size=None): |
| 391 | image_size = image_size or self.base_image_input_size |
no test coverage detected