SuperAPI AI 工具集

vision-bench

设计与创作

查看项目

更新于 10-16 08:48

技能介绍

用途:用视觉 LLM 作为评审,对图片按结构化评分标准打分并对比,可用于比较 AI 生成图片、评估图像质量与文档/图表理解效果。

主要能力:内置 11 个 YAML 评分预设,覆盖 text_to_image(比较 Midjourney、DALL-E、Flux 等生成器)、photorealism、artistic_style、portrait、product_photo、document_ocr、chart_analysis、invoice、ui_screenshot、scientific、alt_text。支持单图评分与多图对比,支持多评审共识(--judges 同时指定多个模型),也支持自定义 YAML 标准(--criteria path/to/my.yaml)。评审模型来源按前缀识别:gpt-/o1/o3/o4 为 OpenAI,claude- 为 Anthropic,gemini- 为 Google,pixtral-/mistral-/ministral- 为 Mistral,openrouter/ 前缀可调用任意视觉模型。报告可输出 markdown(默认)、json 或 table,并可保存到文件。

使用方式:先安装依赖 pip install pyyaml openai anthropic mistralai。单图评分示例:python bench.py image.png --criteria photorealism --judge gemini-2.5-flash。双图对比示例:python bench.py img_a.png img_b.png --criteria text_to_image --prompt "a fox in a snowy forest" --judge gpt-4o。多评审共识可写 --judges gpt-4o gemini-2.5-flash claude-opus-4-5-20251022。查看全部预设:python bench.py --list-presets。保存报告:python bench.py img.png --criteria chart_analysis --save report.md。

密钥与文件:API 密钥从 secrets.enc.yaml(SOPS + age 加密)加载,未命中时回退到环境变量,支持 OPENAI_API_KEY、ANTHROPIC_API_KEY、GEMINI_API_KEY、OPENROUTER_API_KEY。项目文件包括 bench.py(CLI 入口)、judge.py(多提供方评审逻辑)、report.py(报告生成)、vault.py(SOPS 解密)、criteria/(11 个 YAML 预设)、.sops.yaml、secrets.enc.yaml。

限制:资料未提供费用、性能基准、评分准确度、支持平台及具体预设评分细则;实际效果取决于所选视觉模型与自定义标准。密钥需自备,