#!/usr/bin/env python3 # -*- coding: utf-8 -*- """生成分辨率对比报告:20行(4图×5发型) × 4列(原图不缩放/896/768/640)。""" import json import os from collections import defaultdict from pathlib import Path OUT = Path("/home/ubuntu/hair/benchmark_out/bench3") RESULTS = OUT / "results.json" HTML = OUT / "report.html" def img_src(path): if not path or not os.path.isfile(path): return None return "bench3/" + os.path.basename(path) def main(): d = json.load(open(RESULTS, encoding="utf-8")) titles = d["res_titles"] rows = d["rows"] # 各分辨率平均耗时 col_stats = defaultdict(lambda: {"total": [], "comfy": []}) for r in rows: for c in r["cells"]: if c.get("ok"): col_stats[c["res_title"]]["total"].append(c["total_ms"]) col_stats[c["res_title"]]["comfy"].append(c.get("comfy_ms", 0)) # 表头 headers = ['
4图×5发型=20行 · 每行4分辨率(原图不缩放/896/768/640) · steps=15 · 热数据 · 80/80成功 · 峰值21.2GB · 0 OOM