MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / __init__

Method __init__

accessory/data/transform.py:12–17  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

10
11class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected