Browse Source

性别问题

rambo 2 months ago
parent
commit
05594b0d31
2 changed files with 4 additions and 3 deletions
  1. 2 1
      python/api.py
  2. 2 2
      python/service/online_request/module_online_data.py

+ 2 - 1
python/api.py

@@ -608,6 +608,7 @@ async def process_handle_detail(request: Request, params: HandlerDetail):
                 first_pics = first_goods_art_no_info.get("pics")
                 gender = goods_art_dict_info.get("性别")
                 model_id = man_id if "男" in gender else women_id
+                face_type = 1 if "男" in gender else 0
                 ceshi_image_path = first_pics.get("正面-抠图")
                 print("first_pics", ceshi_image_path)
                 save_root_path = ceshi_image_path.split("阴影图处理")[0]
@@ -619,7 +620,7 @@ async def process_handle_detail(request: Request, params: HandlerDetail):
                 shutil.copy(ceshi_image_path, save_image_path)
                 try:
                     image_path = aigc_clazz.generateModelFitting(
-                        save_image_path, model_id, save_image_path
+                        save_image_path, model_id, face_type, save_image_path
                     )
                     goods_art_dict_info["模特图"] = image_path
                     new_goods_dict[goods_art_no] = goods_art_dict_info

+ 2 - 2
python/service/online_request/module_online_data.py

@@ -201,7 +201,7 @@ class AIGCDataRequest(object):
         print("上脚图save_image_path",result_image, save_image_path)
         return save_image_path
 
-    def generateModelFitting(self, local_path, model_id, save_path):
+    def generateModelFitting(self, local_path, model_id, face_type, save_path):
         """生成上脚图"""
         imageUrl = self.uploadImage(local_path)
         data = {
@@ -209,7 +209,7 @@ class AIGCDataRequest(object):
             "scene_key": model_id,
             "topsImg": imageUrl,
             "generate_type": 1,
-            "face_type": 1,
+            "face_type": face_type,
             "pname": "ModelFitting_clothing",
         }
         print("生成上脚图", local_path, model_id, save_path)