#!/usr/bin/env python3 """生成 v3 wave发型 分辨率对比报告:每行=原图+5档,21行;含各档耗时统计。""" import json, os, html OUT = "/home/ubuntu/hair/image/wave_test/out" REPORT = os.path.join(OUT, "report.html") results = json.load(open(os.path.join(OUT, "report.json"))) SIDES = [("origin", "原图直送", 0), ("s1024", "1024", 1024), ("s896", "896", 896), ("s768", "768", 768), ("s640", "640", 640)] # 图片顺序(与测试脚本一致):girl_img 排序 + asdf + qwer IMG_DIR = "/home/ubuntu/hair/image" IMAGES = [] for f in sorted(os.listdir(os.path.join(IMG_DIR, "girl_img"))): if f.lower().endswith((".jpg", ".jpeg", ".png")): IMAGES.append(os.path.splitext(f)[0]) IMAGES.append("asdf") IMAGES.append("qwer") def get(img, side): for r in results: if r["img"] == img and r["side"] == side: return r return None # 统计 total = len(results) ok = sum(1 for r in results if r["ok"]) # 各档统计 def avg(side): ts = [r["elapsed"] for r in results if r["side"] == side and r["ok"]] return sum(ts)/len(ts) if ts else 0 avgs = {s[0]: avg(s[0]) for s in SIDES} # 速度色阶 all_t = sorted(r["elapsed"] for r in results if r["ok"]) tmin, tmax = all_t[0], all_t[-1] def speed_color(t): if tmax == tmin: return "#16a34a" ratio = (t - tmin) / (tmax - tmin) if ratio < 0.33: return "#16a34a" elif ratio < 0.66: return "#f59e0b" else: return "#dc2626" # 表格行 rows_html = [] for img in IMAGES: orig_cell = (f'

POST /api/v1/hair/grow · female · wave(波浪) · 21 图 × 5 档分辨率 = 105 次 · 串行 · 4090 (24G)
| 📷 原图 | 原图直送 (0) 不缩放 |
1024 | 896 默认 |
768 | 640 |
|---|