(pil_image, target_width, target_height)
| 29 | |
| 30 | |
| 31 | def resize_without_crop(pil_image, target_width, target_height): |
| 32 | resized_image = pil_image.resize((target_width, target_height), Image.LANCZOS) |
| 33 | return np.array(resized_image)[:, :, :3] |
| 34 | |
| 35 | |
| 36 | @torch.inference_mode() |