MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / read_image

Function read_image

demo/script.py:186–193  ·  view source on GitHub ↗
(image_file)

Source from the content-addressed store, hash-verified

184 return model, tokenizer
185
186def read_image(image_file):
187 if image_file.startswith('http') or image_file.startswith('https'):
188 response = requests.get(image_file)
189 image = Image.open(BytesIO(response.content)).convert('RGB')
190 else:
191 image = Image.open(image_file).convert('RGB')
192
193 return image
194
195def load_image(image, input_size=224):
196 crop_pct = 224 / 256

Callers 2

post_questionMethod · 0.85
script.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected