初始化:换发型/换发色/训练发型服务
包含: - hair_service_sd: 主服务(换发型/换发色/生发,端口8801) - photo_service: LoRA调度+训练(端口32678) - hair_grow_service: 调试测试页(端口8888,含4个测试页) - 批量训练脚本(batch_train_hairstyles.py) - 发际线mask自动识别(hairline_mask.py,4种方案) - 手绘mask换发型(hair_swap_manual.py) - 文档:README.md + LARGE_FILES.md + docs/ 大文件(模型权重200G、训练数据123G)已排除,见 LARGE_FILES.md OSS/COS密钥已脱敏为环境变量,原文件备份在本地
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
callback_hairstyle_url = "https://puton.meidaojia.com/api/cloth/callBack"
|
||||
|
||||
def callback_color(color_id, cover_img, success):
|
||||
url = "http://172.21.0.3:8080/ydapp/system/platform/complete_color_model"
|
||||
payload = json.dumps({
|
||||
"success": success,
|
||||
"colorId": color_id,
|
||||
"coverImg": cover_img
|
||||
})
|
||||
headers = {
|
||||
'X-MZ-API-TOKEN': '98bcf37c942a2240ba2d907c96ed1137',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
return response
|
||||
# print(response.text)
|
||||
|
||||
|
||||
def callback_hairstyle(req_id, state, message, clothId):
|
||||
url = callback_hairstyle_url
|
||||
payload = json.dumps({
|
||||
"taskId": req_id,
|
||||
"status": state,
|
||||
"clothId": clothId,
|
||||
"msg": message
|
||||
})
|
||||
|
||||
status = -1
|
||||
|
||||
print(f"url:{url},complete_hair_model payload:{payload}")
|
||||
|
||||
headers = {
|
||||
'X-MZ-API-TOKEN': '98bcf37c942a2240ba2d907c96ed1137',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
try:
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
print("response:", response.text)
|
||||
status = 0
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
return response.text, status
|
||||
Reference in New Issue
Block a user