|
|
@@ -567,38 +567,36 @@ async def _process_scene_images(aigc_clazz, run_main, return_data_check_before_d
|
|
|
)
|
|
|
|
|
|
for goods_art_no in goods_dict.keys():
|
|
|
- product_scene_finish_progress += 1
|
|
|
- product_scene_progress = {
|
|
|
- "status": "正在处理",
|
|
|
- "goods_art_no": goods_art_no,
|
|
|
- "current": product_scene_finish_progress,
|
|
|
- "total": product_scene_total_progress,
|
|
|
- "error": product_scene_error_progress
|
|
|
- }
|
|
|
-
|
|
|
- await sendAsyncMessage(
|
|
|
- msg="正在处理场景图",
|
|
|
- goods_arts=[goods_art_no],
|
|
|
- status="正在处理场景图",
|
|
|
- msg_type="scene_progress",
|
|
|
- progress=product_scene_progress
|
|
|
- )
|
|
|
-
|
|
|
- goods_art_dict_info = goods_dict[goods_art_no]
|
|
|
- first_goods_art_no_info = goods_art_dict_info.get("货号资料", [])[0]
|
|
|
- first_pics = first_goods_art_no_info.get("pics")
|
|
|
- ceshi_image_path = first_pics.get("侧视-抠图")
|
|
|
- save_root_path = ceshi_image_path.split("阴影图处理")[0]
|
|
|
- save_image_path = f"{save_root_path}场景图.jpg"
|
|
|
-
|
|
|
- if os.path.isfile(save_image_path):
|
|
|
- goods_art_dict_info["场景图"] = save_image_path
|
|
|
- new_goods_dict[goods_art_no] = goods_art_dict_info
|
|
|
- continue
|
|
|
-
|
|
|
- aigc_clazz.center_paste_image(ceshi_image_path, save_image_path)
|
|
|
-
|
|
|
try:
|
|
|
+ product_scene_finish_progress += 1
|
|
|
+ product_scene_progress = {
|
|
|
+ "status": "正在处理",
|
|
|
+ "goods_art_no": goods_art_no,
|
|
|
+ "current": product_scene_finish_progress,
|
|
|
+ "total": product_scene_total_progress,
|
|
|
+ "error": product_scene_error_progress
|
|
|
+ }
|
|
|
+
|
|
|
+ await sendAsyncMessage(
|
|
|
+ msg="正在处理场景图",
|
|
|
+ goods_arts=[goods_art_no],
|
|
|
+ status="正在处理场景图",
|
|
|
+ msg_type="scene_progress",
|
|
|
+ progress=product_scene_progress
|
|
|
+ )
|
|
|
+ goods_art_dict_info = goods_dict[goods_art_no]
|
|
|
+ first_goods_art_no_info = goods_art_dict_info.get("货号资料", [])[0]
|
|
|
+ first_pics = first_goods_art_no_info.get("pics")
|
|
|
+ ceshi_image_path = first_pics.get("侧视-抠图")
|
|
|
+ save_root_path = ceshi_image_path.split("阴影图处理")[0]
|
|
|
+ save_image_path = f"{save_root_path}场景图.jpg"
|
|
|
+
|
|
|
+ if os.path.isfile(save_image_path):
|
|
|
+ goods_art_dict_info["场景图"] = save_image_path
|
|
|
+ new_goods_dict[goods_art_no] = goods_art_dict_info
|
|
|
+ continue
|
|
|
+
|
|
|
+ aigc_clazz.center_paste_image(ceshi_image_path, save_image_path)
|
|
|
image_path = aigc_clazz.generateProductScene(
|
|
|
save_image_path, product_scene_prompt, save_image_path
|
|
|
)
|