This commit is contained in:
xsl
2026-09-26 16:23:59 +08:00
parent 5957ef04fc
commit ab9a39a8f3
11 changed files with 683 additions and 0 deletions
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Face++ skinanalyze_pro 标准调用
# 用法: call_skinanalyze.sh <图片路径> [输出json路径]
set -euo pipefail
set -a; source "${CREDENTIALS_ENV:-$HOME/.openclaw/credentials.env}"; set +a
IMG=${1:?用法: call_skinanalyze.sh <图片路径> [输出json]}
OUT=${2:-/tmp/skinanalyze_result.json}
curl -s "${FACEPP_SKINANALYZE_URL:-https://api-cn.faceplusplus.com/facepp/v1/skinanalyze_pro}" \
-F api_key=$FACEPP_API_KEY -F api_secret=$FACEPP_API_SECRET -F image_file=@"$IMG" \
-F "return_maps=water_area,red_area,brown_area,texture_enhanced_pores,texture_enhanced_blackheads,texture_enhanced_oily_area,texture_enhanced_lines,rough_area,roi_outline_map,texture_enhanced_bw" \
-F "return_marks=wrinkle_mark,melanin_mark,dark_circle_outline" | tee "$OUT"
python3 - "$OUT" <<'PY'
import json,sys
d=json.load(open(sys.argv[1]))
assert 'error_message' not in d, d.get('error_message')
print('OK, top keys:', ', '.join(sorted(d.keys())[:10]))
PY