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

Function load_image

accessory/demos/multi_model_cli.py:13–17  ·  view source on GitHub ↗
(image_path, model)

Source from the content-addressed store, hash-verified

11END = '\033[0m'
12
13def load_image(image_path, model):
14 transform_type = "padded_resize" # or "resized_center_crop"
15 transform = get_transform(transform_type, getattr(model.llma, 'image_size', 224))
16 image = Image.open(image_path).convert("RGB")
17 return transform(image).unsqueeze(0).cuda().bfloat16()
18
19def main(model, image_path, instruction):
20 image = load_image(image_path, model)

Callers 1

mainFunction · 0.85

Calls 1

get_transformFunction · 0.90

Tested by

no test coverage detected