MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / compute_poster_image_ppl

Function compute_poster_image_ppl

utils/poster_eval_utils.py:229–237  ·  view source on GitHub ↗
(images)

Source from the content-addressed store, hash-verified

227
228
229def compute_poster_image_ppl(images):
230 max_ctx = 128_000 # max visual tokens for Qwen2.5-VL
231 truncated_images = truncate_images_to_fit(images, max_ctx=max_ctx)
232 img_uris = [pil_to_data_uri(image, fmt="PNG") for image in truncated_images]
233 content = [
234 {"type": "image_url", "image_url": {"url": img_uri}} for img_uri in img_uris
235 ]
236
237 return compute_vlm_ppl(content)
238
239
240def compute_clip_embeddings(folder, model, processor, device):

Callers 1

Calls 3

truncate_images_to_fitFunction · 0.70
pil_to_data_uriFunction · 0.70
compute_vlm_pplFunction · 0.70

Tested by

no test coverage detected