Install any skill in seconds. Free to start, no credit card required.
Get Started Free →本技能是 PaperFit 视觉排版优化闭环中的关键环节,专门负责 **PDF 页图渲染与视觉验收指导**。它封装了将 PDF 转换为逐页高分辨率图片的标准化流程,并为 `layout-detective-agent` 和 `quality-gatekeeper-agent` 提供详细的逐页视觉检查清单。
.claude/skills/openraiser-visual-inspector-skill/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 999% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 177% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 141% | 0% |
本技能是 PaperFit 视觉排版优化闭环中的关键环节,专门负责 PDF 页图渲染与视觉验收指导。它封装了将 PDF 转换为逐页高分辨率图片的标准化流程,并为 layout-detective-agent 和 quality-gatekeeper-agent 提供详细的逐页视觉检查清单。
该技能由 orchestrator-agent 在每次编译后调用,确保多模态证据链中的“页图”环节可靠、一致且可复现。
/check-visual 命令)。| 输入项 | 来源 | 必需 | 说明 | |--------|------|------|------| | PDF 文件路径 | 编译输出 | ✅ | 通常为 main.pdf | | 输出目录 | 配置或默认 | ✅ | 页图存放目录,默认为 data/pages/ | | DPI 参数 | 配置或调用方指定 | ✅ | 渲染分辨率,默认 220 DPI | | 页码范围 | 调用方指定 | ⚠️ | 若为空,渲染全部页面 | | 局部裁剪参数 | 调用方指定 | ⚠️ | 如 {page: 5, bbox: [x,y,w,h]},用于表格/公式局部复查 |
本技能输出两份产物:
page_001.png、page_002.png 等。json{ "skill": "visual-inspector", "status": "success | partial | failed", "pdf_path": "main.pdf", "output_dir": "data/pages/", "dpi": 220, "pages_rendered": 9, "page_files": [ {"page": 1, "file": "data/pages/page_001.png", "width": 1700, "height": 2200}, {"page": 2, "file": "data/pages/page_002.png", "width": 1700, "height": 2200} ], "cropped_regions": [ { "page": 5, "object": "Table 2", "file": "data/pages/page_005_table2.png", "bbox": [100, 450, 800, 300] } ], "errors": [] }
pdf2image 库pdftoppm 或 pdftocairo)若 Poppler 未安装,根据操作系统提供安装指引:
bash# Debian/Ubuntu sudo apt-get install poppler-utils # macOS brew install poppler # Windows # 下载 poppler 并添加到 PATH,或使用 conda install -c conda-forge poppler
禁止在用户 LaTeX 项目里假设存在 scripts/render_pages.py。页图渲染由 PaperFit npm/CLI 包提供,在论文项目根目录执行:
bashpaperfit render <相对或绝对路径的.pdf> --output data/pages --dpi 220 # 示例 paperfit render main.pdf --dpi 300
前提:npm install -g paperfit-cli(或等价全局安装),paperfit 在 PATH 中。输出目录 --output 相对于当前工作目录(一般为论文根目录)。
其它包内 Python/Bash(如 parse_log.py、state_manager.py)一律在论文根目录使用 paperfit run scripts/<文件名> [参数…],勿在用户项目里假设存在同名 scripts/。
若仅能通过 Python 调用包内脚本,先执行 paperfit root 得到包根目录,再:
python3 "$(paperfit root)/scripts/render_pages.py" main.pdf --dpi 220
(或直接调用 pdf2image 库,逻辑须与下方一致。)全局未装 paperfit 时可用:npx paperfit-cli render …。
pythonfrom pdf2image import convert_from_path pages = convert_from_path( pdf_path, dpi=220, fmt='png', thread_count=2, grayscale=False, size=None ) for i, page in enumerate(pages, start=1): page.save(f"{output_dir}/page_{i:03d}.png", "PNG")
| 场景 | DPI | 说明 | |------|-----|------| | 整页常规检查 | 180-220 | 平衡清晰度与文件大小 | | 表格/公式细节复查 | 260-320 | 需清晰辨认小字号或密集内容 | | 局部裁剪复查 | 320 | 聚焦特定区域,可接受较大文件 |
当 layout-detective-agent 需要对特定表格、公式或段落进行高精度复查时,可请求渲染局部区域。
page_005_table2.png)。裁剪示例:
pythonfrom PIL import Image full_page = Image.open(f"{output_dir}/page_005.png") cropped = full_page.crop((x1, y1, x2, y2)) cropped.save(f"{output_dir}/page_005_table2.png")
记录渲染结果,包括:
以下清单供 layout-detective-agent 在逐页审查时参考。本技能不执行检查,仅提供指导框架。
paperfit run scripts/detect_column_void.py data/pages -o data/column_void_report.json,将机器投影结果与肉眼结论交叉验证Acknowledgements / References / Bibliography 的页上是否出现正文图表标题或正文浮动体?若有,按硬失败处理。booktabs 风格。orchestrator-agent 在编译成功后调用本技能。layout-detective-agent 使用页图进行视觉缺陷检测。quality-gatekeeper-agent 使用页图进行最终验收对比。code-surgeon-agent 在修复后可能请求局部页图验证特定修改。| 异常情况 | 处理方式 | |----------|----------| | Poppler 未安装 | 返回明确错误信息,包含安装指引 | | PDF 文件损坏 | 报告错误,请求重新编译 | | 部分页渲染失败 | 记录失败页码,尽可能渲染其余页,状态标记为 partial | | 磁盘空间不足 | 报告错误,清理临时目录或提示用户释放空间 |
Visual Inspector Skill 就绪。
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | pass→pass | 12,758 | 3,191 | -75% | 1 | 1 | 0% | 2,082 | 3,172 | +52% | 0 | 0 | — |
case-01 | fail→pass | 11,701 | 7,477 | -36% | 1 | 1 | 0% | 2,398 | 3,960 | +65% | 0 | 0 | — |
case-02 | fail→fail | 8,270 | 7,434 | -10% | 1 | 1 | 0% | 283 | 3,933 | +1290% | 0 | 0 | — |
case-16 | fail→pass | 11,562 | 5,273 | -54% | 1 | 1 | 0% | 1,695 | 3,441 | +103% | 0 | 0 | — |
case-03 | fail→pass | 9,267 | 8,040 | -13% | 1 | 1 | 0% | 367 | 4,033 | +999% | 0 | 0 | — |
case-04 | fail→fail | 10,982 | 9,761 | -11% | 1 | 1 | 0% | 1,336 | 4,088 | +206% | 0 | 0 | — |
case-05 | fail→fail | 4,955 | 6,028 | +22% | 1 | 1 | 0% | 213 | 2,883 | +1254% | 0 | 0 | — |
case-06 | fail→fail | 4,304 | 9,005 | +109% | 1 | 1 | 0% | 652 | 4,273 | +555% | 0 | 0 | — |
case-07 | fail→pass | 6,990 | 4,433 | -37% | 1 | 1 | 0% | 1,200 | 3,323 | +177% | 0 | 0 | — |
case-08 | fail→pass | 8,834 | 5,498 | -38% | 1 | 1 | 0% | 1,441 | 3,477 | +141% | 0 | 0 | — |
case-09 | fail→pass | 13,729 | 2,723 | -80% | 1 | 1 | 0% | 2,494 | 3,082 | +24% | 0 | 0 | — |
case-10 | fail→pass | 10,665 | 4,192 | -61% | 1 | 1 | 0% | 1,867 | 3,412 | +83% | 0 | 0 | — |
case-12 | pass→pass | 2,623 | 2,135 | -19% | 1 | 1 | 0% | 409 | 2,905 | +610% | 0 | 0 | — |
case-13 | fail→pass | 10,383 | 5,764 | -44% | 1 | 1 | 0% | 1,833 | 3,618 | +97% | 0 | 0 | — |
case-14 | fail→fail | 11,161 | 8,545 | -23% | 1 | 1 | 0% | 2,030 | 4,202 | +107% | 0 | 0 | — |
case-15 | fail→pass | 10,234 | 2,804 | -73% | 1 | 1 | 0% | 1,767 | 3,049 | +73% | 0 | 0 | — |
case-17 | pass→pass | 10,706 | 2,498 | -77% | 1 | 1 | 0% | 1,658 | 2,957 | +78% | 0 | 0 | — |
case-18 | pass→pass | 3,625 | 2,265 | -38% | 1 | 1 | 0% | 510 | 2,852 | +459% | 0 | 0 | — |
case-19 | fail→pass | 11,801 | 5,006 | -58% | 1 | 1 | 0% | 1,712 | 3,383 | +98% | 0 | 0 | — |
case-20 | pass→pass | 7,852 | 2,788 | -64% | 1 | 1 | 0% | 1,329 | 3,026 | +128% | 0 | 0 | — |
case-21 | fail→fail | 8,716 | 3,906 | -55% | 1 | 1 | 0% | 1,331 | 3,302 | +148% | 0 | 0 | — |
case-22 | fail→pass | 6,893 | 3,848 | -44% | 1 | 1 | 0% | 1,180 | 3,250 | +175% | 0 | 0 | — |
case-23 | pass→pass | 7,146 | 2,786 | -61% | 1 | 1 | 0% | 1,015 | 2,967 | +192% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 20 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +48 percentage points is the difference between those two pass rates over the 20 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.