pad an image to squre (borrowed from LLAVA, thx) :param background_color: rgb values for padded pixels, normalized to [0, 1]
(self, background_color:Tuple[float, float, float])
| 10 | |
| 11 | class PadToSquare: |
| 12 | def __init__(self, background_color:Tuple[float, float, float]): |
| 13 | """ |
| 14 | pad an image to squre (borrowed from LLAVA, thx) |
| 15 | :param background_color: rgb values for padded pixels, normalized to [0, 1] |
| 16 | """ |
| 17 | self.bg_color = tuple(int(x*255) for x in background_color) |
| 18 | |
| 19 | def __call__(self, img: Image.Image): |
| 20 | width, height = img.size |
nothing calls this directly
no outgoing calls
no test coverage detected