MCPcopy Create free account
hub / github.com/apple/ml-streambridge / load_image

Function load_image

eval/utils.py:149–157  ·  view source on GitHub ↗
(image_file, pad=False)

Source from the content-addressed store, hash-verified

147 return cropped_img
148
149def load_image(image_file, pad=False):
150 if image_file.startswith('http') or image_file.startswith('https'):
151 response = requests.get(image_file)
152 image = Image.open(BytesIO(response.content)).convert('RGB')
153 else:
154 image = Image.open(image_file).convert('RGB')
155 if pad:
156 image = expand2square(image)
157 return image
158
159def load_txt(path):
160 strings_list = []

Callers

nothing calls this directly

Calls 1

expand2squareFunction · 0.70

Tested by

no test coverage detected