page.get_images() only returns raster blobs embedded in the PDF's resource dictionary, so vector schematics like Figure 1 — drawn purely with paths/lines — were never extracted, and the VLM only ever saw incidental embedded photos that happened to live near figures. Replace the xref-based extraction with bbox rendering: union the bounding rects of all vector drawings and raster image_info entries on each page, expand a few points, and render the region with get_pixmap(clip=bbox, matrix=2x). The captioner now receives the actual figure — schematic arrows, box labels, legend text, and any inset photos — and produces a caption that describes the figure as a whole, not just one embedded sub-image. Also sharpen the captioner prompt: explicitly tell the VLM the image is a single figure cropped from a PDF page, and not to describe page chrome or body paragraphs. |
||
|---|---|---|
| .. | ||
| assets | ||
| auth | ||
| core | ||
| loggers | ||
| models | ||
| plugins | ||
| requirements | ||
| routes | ||
| state | ||
| storage | ||
| tests | ||
| utils | ||
| __init__.py | ||
| _platform_compat.py | ||
| colab.py | ||
| main.py | ||
| run.py | ||
| startup_banner.py | ||