MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / load_image

Function load_image

eval/run_predict_aguvis.py:467–484  ·  view source on GitHub ↗

Origin code for loading the image. Args: image_file (str): the path or the url of the image. Note we didn't do any resize action here. Returns: Image: the Image class.

(image_file: str)

Source from the content-addressed store, hash-verified

465 """
466
467 def load_image(image_file: str) -> Image:
468 """
469 Origin code for loading the image.
470
471 Args:
472 image_file (str): the path or the url of the image.
473
474 Note we didn't do any resize action here.
475
476 Returns:
477 Image: the Image class.
478 """
479 if image_file.startswith(("http://", "https://")):
480 response = requests.get(image_file)
481 image = Image.open(BytesIO(response.content)).convert("RGB")
482 else:
483 image = Image.open(image_file).convert("RGB")
484 return image
485
486 image: Image = load_image(image_path)
487 instruction:str = episode['instruction']

Callers 1

process_dataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected