This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| from typing import Tuple | |
| def resize_with_pad(image: np.array, | |
| new_shape: Tuple[int, int], | |
| padding_color: Tuple[int] = (255, 255, 255)) -> np.array: | |
| """Maintains aspect ratio and resizes with padding. | |
| Params: | |
| image: Image to be resized. |