This commit is contained in:
xsl
2026-07-17 22:13:56 +08:00
parent 2606aca7c5
commit b2738fba7d
28 changed files with 126 additions and 126 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
"""换发型接口测试"""
import base64, json, requests, sys, time
img_path = "/home/xsl/change_hair/project/data/userImage/8488902485_20250630055547.jpg"
img_path = "/home/ubuntu/change_hair/project/data/userImage/8488902485_20250630055547.jpg"
with open(img_path, "rb") as f:
img_b64 = base64.b64encode(f.read()).decode()
@@ -22,7 +22,7 @@ try:
print(f"HTTP {r.status_code} | msg={d.get('msg')} | state={d.get('state')} | 耗时={time.time()-t0:.1f}s")
data = d.get("data", "")
if d.get("state") == 0 and data:
out = "/home/xsl/change_hair/project/logs/test_swaphair_result.jpg"
out = "/home/ubuntu/change_hair/project/logs/test_swaphair_result.jpg"
with open(out, "wb") as f:
f.write(base64.b64decode(data))
print(f"✅ 换发型成功! 结果图已保存: {out} ({len(data)} bytes base64)")