MCPcopy Index your code
hub / github.com/OpenBMB/AgentCPM-GUI / encode

Method encode

eval/utils/utils_odyssey/visual.py:416–426  ·  view source on GitHub ↗
(self, image_paths: List[str])

Source from the content-addressed store, hash-verified

414 return x
415
416 def encode(self, image_paths: List[str]):
417 images = []
418 for image_path in image_paths:
419 if image_path.startswith("http://") or image_path.startswith("https://"):
420 image = Image.open(requests.get(image_path, stream=True).raw)
421 else:
422 image = Image.open(image_path)
423 image = image.convert("RGB")
424 images.append(self.image_transform(image))
425 images = torch.stack(images, dim=0)
426 return self(images)

Callers 10

forwardMethod · 0.80
get_stop_words_idsFunction · 0.80
make_contextFunction · 0.80
_tokenize_strFunction · 0.80
tokenizeMethod · 0.80
_decode_imgurlMethod · 0.80
to_list_formatMethod · 0.80
_encode_vl_infoMethod · 0.80
_async_samplingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected