MCPcopy Create free account
hub / github.com/CodeGoat24/UniGenBench / _encode_image

Method _encode_image

eval/src/vllm_request.py:53–58  ·  view source on GitHub ↗
(self, image)

Source from the content-addressed store, hash-verified

51 return session
52
53 def _encode_image(self, image):
54 with Image.open(image) as img:
55 img = img.convert("RGB")
56 buffered = BytesIO()
57 img.save(buffered, format="JPEG", quality=95)
58 return base64.b64encode(buffered.getvalue()).decode("utf-8")
59
60 def _get_cached_base64(self, image_path):
61 with self._cache_lock:

Callers 1

_get_cached_base64Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected