chore: finalize delivery cleanup

This commit is contained in:
yangqianqian
2026-06-30 18:41:16 +08:00
parent df1856d793
commit 341f3d2b0d
25 changed files with 48 additions and 1054 deletions

View File

@@ -31,7 +31,8 @@ TEST_PROMPT = "\n".join([
"避免美白/祛斑/速效/医用等违规词;必须保持产品包装与参考图一致。",
])
_REF = ROOT / "test/output/01_连通测试.png"
_REF_ENV = os.environ.get("REAL_IMAGE_REF", "").strip()
_REF = Path(_REF_ENV).expanduser() if _REF_ENV else None
async def _apiports(key, url, ref, model, size):
@@ -73,6 +74,11 @@ async def run():
fallback = os.environ.get("IMAGE_PROVIDER_FALLBACK", "codeproxy").lower()
out_dir = Path(__file__).parent.parent / "verify_output"
out_dir.mkdir(parents=True, exist_ok=True)
if _REF is None or not _REF.exists() or not _REF.is_file():
raise FileNotFoundError(
"请通过 REAL_IMAGE_REF 指定本地参考图路径,例如:"
"REAL_IMAGE_REF=/path/to/ref.png python3 scripts/real_image_check.py"
)
ref = _REF.read_bytes()
t0 = time.time(); img = None; used = None
for prov in [primary, fallback]: