|
|
@@ -6,7 +6,7 @@ from threading import Lock
|
|
|
from middleware import UnicornException
|
|
|
import settings
|
|
|
from collections import defaultdict
|
|
|
-from .remove_bg_ali import RemoveBgALi, Picture
|
|
|
+from .remove_bg_ali import RemoveBgALi, Picture, RemoveUltraBackground
|
|
|
from .deal_cutout import DealCutout
|
|
|
|
|
|
import time
|
|
|
@@ -24,7 +24,9 @@ import copy, asyncio
|
|
|
from settings import sendSocketMessage
|
|
|
from utils.common import message_queue
|
|
|
from logger import logger
|
|
|
-def sendAsyncMessage(msg="", goods_arts=[], status="",progress={}):
|
|
|
+
|
|
|
+
|
|
|
+def sendAsyncMessage(msg="", goods_arts=[], status="", progress={}):
|
|
|
"""异步发送消息"""
|
|
|
data = {
|
|
|
"code": 0,
|
|
|
@@ -34,15 +36,15 @@ def sendAsyncMessage(msg="", goods_arts=[], status="",progress={}):
|
|
|
"status": status,
|
|
|
"goods_art_nos": goods_arts,
|
|
|
},
|
|
|
- "progress":{
|
|
|
- "msg_type":"segment_progress",
|
|
|
- "name":"抠图",
|
|
|
- "goods_art_no":progress.get("goods_art_no",""),
|
|
|
- "status":progress.get("status"),
|
|
|
- "current":progress.get("current",0),
|
|
|
- "total":progress.get("total",0),
|
|
|
- "error":progress.get("error",0)
|
|
|
- },
|
|
|
+ "progress": {
|
|
|
+ "msg_type": "segment_progress",
|
|
|
+ "name": "抠图",
|
|
|
+ "goods_art_no": progress.get("goods_art_no", ""),
|
|
|
+ "status": progress.get("status"),
|
|
|
+ "current": progress.get("current", 0),
|
|
|
+ "total": progress.get("total", 0),
|
|
|
+ "error": progress.get("error", 0)
|
|
|
+ },
|
|
|
"msg_type": "segment_progress",
|
|
|
}
|
|
|
message_queue.put_nowait(data)
|
|
|
@@ -65,14 +67,14 @@ class BaseDealImage(object):
|
|
|
pass
|
|
|
|
|
|
def run_main(
|
|
|
- self,
|
|
|
- all_goods_art_no_folder_data,
|
|
|
- callback_func=None,
|
|
|
- cutout_mode=None,
|
|
|
- resize_image_view=None,
|
|
|
- windows=None,
|
|
|
- logo_path=None,
|
|
|
- image_order_list=None,
|
|
|
+ self,
|
|
|
+ all_goods_art_no_folder_data,
|
|
|
+ callback_func=None,
|
|
|
+ cutout_mode=None,
|
|
|
+ resize_image_view=None,
|
|
|
+ windows=None,
|
|
|
+ logo_path=None,
|
|
|
+ image_order_list=None,
|
|
|
):
|
|
|
"""
|
|
|
执行主流程处理
|
|
|
@@ -87,7 +89,7 @@ class BaseDealImage(object):
|
|
|
}
|
|
|
"""
|
|
|
from logger import logger
|
|
|
-
|
|
|
+
|
|
|
# 对所有缺失已抠图的进行抠图处理
|
|
|
self.run_cutout_image(
|
|
|
all_goods_art_no_folder_data=all_goods_art_no_folder_data,
|
|
|
@@ -99,7 +101,7 @@ class BaseDealImage(object):
|
|
|
successful_num = 0
|
|
|
successful_folders = []
|
|
|
failed_folders = []
|
|
|
-
|
|
|
+
|
|
|
for goods_art_no_folder_data in all_goods_art_no_folder_data:
|
|
|
if goods_art_no_folder_data["label"] != "待处理":
|
|
|
continue
|
|
|
@@ -108,7 +110,7 @@ class BaseDealImage(object):
|
|
|
break
|
|
|
folder_name = goods_art_no_folder_data["folder_name"]
|
|
|
callback_func("开始处理文件夹========== {} ".format(folder_name))
|
|
|
-
|
|
|
+
|
|
|
flag = None
|
|
|
if settings.IS_TEST:
|
|
|
flag = self.shoes_run_one_folder_to_deal(
|
|
|
@@ -139,7 +141,7 @@ class BaseDealImage(object):
|
|
|
)
|
|
|
failed_folders.append(goods_art_no_folder_data)
|
|
|
continue
|
|
|
-
|
|
|
+
|
|
|
# 判断处理结果
|
|
|
if flag is None:
|
|
|
callback_func("货号:{} 数据异常".format(folder_name))
|
|
|
@@ -154,9 +156,9 @@ class BaseDealImage(object):
|
|
|
error_num += 1
|
|
|
callback_func("货号:{} 图片生成处理失败".format(folder_name))
|
|
|
failed_folders.append(goods_art_no_folder_data)
|
|
|
-
|
|
|
+
|
|
|
callback_func("处理成功:{}个,失败:{}个".format(successful_num, error_num))
|
|
|
-
|
|
|
+
|
|
|
# 返回详细的处理结果
|
|
|
result = {
|
|
|
'success': error_num == 0,
|
|
|
@@ -165,15 +167,15 @@ class BaseDealImage(object):
|
|
|
'successful_num': successful_num,
|
|
|
'error_num': error_num
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
logger.info(f"[主流程完成] 成功: {successful_num}, 失败: {error_num}")
|
|
|
if failed_folders:
|
|
|
logger.warning(f"[主流程完成] 失败货号列表: {[f['folder_name'] for f in failed_folders]}")
|
|
|
-
|
|
|
+
|
|
|
return result
|
|
|
|
|
|
def checkImageAmount(
|
|
|
- self, image_dir: str, amount: int, todo_goods_art_no_folder_name_list=None
|
|
|
+ self, image_dir: str, amount: int, todo_goods_art_no_folder_name_list=None
|
|
|
) -> dict:
|
|
|
result = {"code": 0, "msg": "", "data": {}}
|
|
|
for goods_art_no_folder in self.list_dir(image_dir):
|
|
|
@@ -189,7 +191,7 @@ class BaseDealImage(object):
|
|
|
if "无法" in goods_art_no_folder:
|
|
|
continue
|
|
|
if "原始图" not in self.list_dir(
|
|
|
- "{}/{}".format(image_dir, goods_art_no_folder)
|
|
|
+ "{}/{}".format(image_dir, goods_art_no_folder)
|
|
|
):
|
|
|
result["data"][goods_art_no_folder] = "文件夹下,没有 原始图 文件夹\n"
|
|
|
continue
|
|
|
@@ -218,7 +220,7 @@ class BaseDealImage(object):
|
|
|
return result
|
|
|
|
|
|
def check_folders_image_amount(
|
|
|
- self, all_goods_art_no_folder_data, image_order_list
|
|
|
+ self, all_goods_art_no_folder_data, image_order_list
|
|
|
):
|
|
|
print("*****************check_folders_image_amount************************")
|
|
|
amount = len(image_order_list)
|
|
|
@@ -268,7 +270,7 @@ class BaseDealImage(object):
|
|
|
imageOrderList = (
|
|
|
image_order.replace(",", ",").replace(" ", "").replace("图", "").split(",")
|
|
|
)
|
|
|
- print("imageOrderList",imageOrderList)
|
|
|
+ print("imageOrderList", imageOrderList)
|
|
|
if len(set(imageOrderList)) != len(imageOrderList):
|
|
|
return {"code": 1, "msg": "图片位置与顺序重复,请检查您的输入"}
|
|
|
|
|
|
@@ -307,7 +309,7 @@ class BaseDealImage(object):
|
|
|
"组合26",
|
|
|
]
|
|
|
if val not in image_orders:
|
|
|
- print("val",val)
|
|
|
+ print("val", val)
|
|
|
image_orders_str = ','.join(map(str, image_orders))
|
|
|
return {
|
|
|
"code": 1,
|
|
|
@@ -320,13 +322,13 @@ class BaseDealImage(object):
|
|
|
return {"code": 0, "msg": "sucess", "imageOrderList": imageOrderList}
|
|
|
|
|
|
def shoes_run_one_folder_to_deal(
|
|
|
- self,
|
|
|
- goods_art_no_folder_data,
|
|
|
- image_order_list: list,
|
|
|
- resize_image_view: str,
|
|
|
- logo_path="",
|
|
|
- windows=None,
|
|
|
- callback_func=None,
|
|
|
+ self,
|
|
|
+ goods_art_no_folder_data,
|
|
|
+ image_order_list: list,
|
|
|
+ resize_image_view: str,
|
|
|
+ logo_path="",
|
|
|
+ windows=None,
|
|
|
+ callback_func=None,
|
|
|
):
|
|
|
"""
|
|
|
操作步骤:
|
|
|
@@ -396,11 +398,11 @@ class BaseDealImage(object):
|
|
|
|
|
|
# 删除目录再新建
|
|
|
try:
|
|
|
- if os.path.exists("{}/阴影图处理".format(folder_path)):
|
|
|
- shutil.rmtree("{}/阴影图处理".format(folder_path),onerror=settings.handle_remove_readonly)
|
|
|
+ if os.path.exists("{}/阴影图处理".format(folder_path)):
|
|
|
+ shutil.rmtree("{}/阴影图处理".format(folder_path), onerror=settings.handle_remove_readonly)
|
|
|
except Exception as e:
|
|
|
- print('An exception occurred')
|
|
|
- logger.info(f"base deal 抠图前目录删除出现问题:{str(e)}")
|
|
|
+ print('An exception occurred')
|
|
|
+ logger.info(f"base deal 抠图前目录删除出现问题:{str(e)}")
|
|
|
|
|
|
self.crate_all_folders(folder_path)
|
|
|
print(
|
|
|
@@ -439,7 +441,7 @@ class BaseDealImage(object):
|
|
|
is_image_deal_mode = 0
|
|
|
print("开始识别左右脚=========>")
|
|
|
if OnePicDeal(self.token).check_shoe_is_right(
|
|
|
- image_path=original_move_bg_image_path
|
|
|
+ image_path=original_move_bg_image_path
|
|
|
):
|
|
|
is_image_deal_mode = 1 # 1表示要镜像,0表示不做镜像
|
|
|
print(
|
|
|
@@ -479,14 +481,14 @@ class BaseDealImage(object):
|
|
|
resize_mode = 2
|
|
|
|
|
|
if (
|
|
|
- settings.getSysConfigs("other_configs", "product_type", "鞋类")
|
|
|
- == "皮具"
|
|
|
+ settings.getSysConfigs("other_configs", "product_type", "鞋类")
|
|
|
+ == "皮具"
|
|
|
):
|
|
|
max_box = (1000, 1200)
|
|
|
out_pic_size = (
|
|
|
[1600]
|
|
|
if settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
- == ""
|
|
|
+ == ""
|
|
|
else settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
) # 主图大小
|
|
|
if resize_mode == 2:
|
|
|
@@ -502,19 +504,19 @@ class BaseDealImage(object):
|
|
|
curve_mask = True if "俯视" in image_order_list else False
|
|
|
try:
|
|
|
if not generate_pic.run(
|
|
|
- image_path=original_image_path,
|
|
|
- cut_image_path=original_move_bg_image_path,
|
|
|
- out_path=out_path,
|
|
|
- image_deal_mode=is_image_deal_mode,
|
|
|
- # resize_mode=resize_mode,
|
|
|
- resize_mode=1,#将这里得缩放模式改为强制不缩放 2025-10-22
|
|
|
- out_pic_size=out_pic_size,
|
|
|
- is_logo=True if i_n == 1 else False,
|
|
|
- out_process_path_1=out_process_path_1,
|
|
|
- out_process_path_2=out_process_path_2,
|
|
|
- max_box=max_box,
|
|
|
- logo_path=logo_path,
|
|
|
- curve_mask=curve_mask,
|
|
|
+ image_path=original_image_path,
|
|
|
+ cut_image_path=original_move_bg_image_path,
|
|
|
+ out_path=out_path,
|
|
|
+ image_deal_mode=is_image_deal_mode,
|
|
|
+ # resize_mode=resize_mode,
|
|
|
+ resize_mode=1, # 将这里得缩放模式改为强制不缩放 2025-10-22
|
|
|
+ out_pic_size=out_pic_size,
|
|
|
+ is_logo=True if i_n == 1 else False,
|
|
|
+ out_process_path_1=out_process_path_1,
|
|
|
+ out_process_path_2=out_process_path_2,
|
|
|
+ max_box=max_box,
|
|
|
+ logo_path=logo_path,
|
|
|
+ curve_mask=curve_mask,
|
|
|
):
|
|
|
print("**********222222222222222222222222222********************")
|
|
|
is_successful = False
|
|
|
@@ -575,12 +577,21 @@ class BaseDealImage(object):
|
|
|
self.check_path(path)
|
|
|
|
|
|
def run_cutout_image(
|
|
|
- self,
|
|
|
- all_goods_art_no_folder_data,
|
|
|
- callback_func=None,
|
|
|
- cutout_mode=1,
|
|
|
- windows=None,
|
|
|
+ self,
|
|
|
+ all_goods_art_no_folder_data,
|
|
|
+ callback_func=None,
|
|
|
+ cutout_mode=1,
|
|
|
+ windows=None,
|
|
|
):
|
|
|
+ cutout_mode_str = "普通抠图"
|
|
|
+ match cutout_mode:
|
|
|
+ case "1":
|
|
|
+ cutout_mode_str = "普通抠图"
|
|
|
+ case "2":
|
|
|
+ cutout_mode_str = "精细化抠图"
|
|
|
+ case "3":
|
|
|
+ cutout_mode_str = "旗舰AI抠图"
|
|
|
+ logger.info(f"当前抠图模式:{cutout_mode_str}")
|
|
|
"""
|
|
|
处理所有的抠图
|
|
|
"""
|
|
|
@@ -592,12 +603,12 @@ class BaseDealImage(object):
|
|
|
total_progress = len(all_goods_art_no_folder_data)
|
|
|
finish_progress = 0
|
|
|
error_progress = 0
|
|
|
- progress = {"status":"正在处理",
|
|
|
- "current":finish_progress,
|
|
|
- "total":total_progress,
|
|
|
- "error":error_progress}
|
|
|
+ progress = {"status": "正在处理",
|
|
|
+ "current": finish_progress,
|
|
|
+ "total": total_progress,
|
|
|
+ "error": error_progress}
|
|
|
sendAsyncMessage(
|
|
|
- msg="开始处理抠图", goods_arts=goods_art_nos, status="开始处理",progress=progress
|
|
|
+ msg="开始处理抠图", goods_arts=goods_art_nos, status="开始处理", progress=progress
|
|
|
)
|
|
|
error_goods_art_no_folder = []
|
|
|
for goods_art_no_folder_data in all_goods_art_no_folder_data:
|
|
|
@@ -609,12 +620,12 @@ class BaseDealImage(object):
|
|
|
images = [x for x in self.list_dir("{}/原始图".format(folder_path))]
|
|
|
cutImageList = []
|
|
|
goods_art_floder_name = goods_art_no_folder_data["folder_name"]
|
|
|
- progress = {"status":"正在处理",
|
|
|
- "current":finish_progress,
|
|
|
- "total":total_progress,
|
|
|
- "error":error_progress,
|
|
|
- "goods_art_no":goods_art_floder_name
|
|
|
- }
|
|
|
+ progress = {"status": "正在处理",
|
|
|
+ "current": finish_progress,
|
|
|
+ "total": total_progress,
|
|
|
+ "error": error_progress,
|
|
|
+ "goods_art_no": goods_art_floder_name
|
|
|
+ }
|
|
|
sendAsyncMessage(
|
|
|
msg="正在抠图",
|
|
|
goods_arts=[goods_art_floder_name],
|
|
|
@@ -637,6 +648,7 @@ class BaseDealImage(object):
|
|
|
if not os.path.exists(original_move_bg_image_path):
|
|
|
# 没有抠图文件,进行抠图生成
|
|
|
callback_func("正在抠图 货号:{}".format(file_name))
|
|
|
+ print("cutout_mode=============>", cutout_mode)
|
|
|
if cutout_mode == "2":
|
|
|
cutImageList.append(
|
|
|
{
|
|
|
@@ -651,33 +663,29 @@ class BaseDealImage(object):
|
|
|
}
|
|
|
)
|
|
|
else:
|
|
|
- remove_pic_ins = RemoveBgALi()
|
|
|
- if settings.IS_TEST:
|
|
|
+ if cutout_mode == "1":
|
|
|
+ remove_pic_ins = RemoveBgALi()
|
|
|
+ if cutout_mode == "3":
|
|
|
+ remove_pic_ins = RemoveUltraBackground()
|
|
|
+ try:
|
|
|
im = remove_pic_ins.get_image_cut(
|
|
|
file_path=original_image_path,
|
|
|
out_file_path=original_move_bg_image_path,
|
|
|
)
|
|
|
- else:
|
|
|
- try:
|
|
|
- im = remove_pic_ins.get_image_cut(
|
|
|
- file_path=original_image_path,
|
|
|
- out_file_path=original_move_bg_image_path,
|
|
|
- )
|
|
|
- except FunctionTimedOut as f:
|
|
|
- callback_func(
|
|
|
- "货号图{} 抠图处理超时~".format(file_name)
|
|
|
- )
|
|
|
- error_goods_art_no_folder.append(folder_path)
|
|
|
- im = None
|
|
|
- except BaseException as e:
|
|
|
- callback_func(
|
|
|
- "货号图{} 抠图处理失败,原因{}".format(
|
|
|
- file_name, e
|
|
|
- )
|
|
|
+ except FunctionTimedOut as f:
|
|
|
+ callback_func(
|
|
|
+ "货号图{} 抠图处理超时~".format(file_name)
|
|
|
+ )
|
|
|
+ error_goods_art_no_folder.append(folder_path)
|
|
|
+ im = None
|
|
|
+ except BaseException as e:
|
|
|
+ callback_func(
|
|
|
+ "货号图{} 抠图处理失败,原因{}".format(
|
|
|
+ file_name, e
|
|
|
)
|
|
|
- error_goods_art_no_folder.append(folder_path)
|
|
|
- im = None
|
|
|
-
|
|
|
+ )
|
|
|
+ error_goods_art_no_folder.append(folder_path)
|
|
|
+ im = None
|
|
|
if not im:
|
|
|
callback_func(
|
|
|
"货号图{} 抠图处理失败~".format(file_name)
|
|
|
@@ -687,14 +695,14 @@ class BaseDealImage(object):
|
|
|
else:
|
|
|
callback_func("货号图{} 抠图完成~".format(file_name))
|
|
|
progress = {
|
|
|
- "status":"正在处理",
|
|
|
- "current":finish_progress,
|
|
|
- "total":total_progress,
|
|
|
- "error":error_progress,
|
|
|
- "goods_art_no":goods_art_floder_name
|
|
|
- }
|
|
|
+ "status": "正在处理",
|
|
|
+ "current": finish_progress,
|
|
|
+ "total": total_progress,
|
|
|
+ "error": error_progress,
|
|
|
+ "goods_art_no": goods_art_floder_name
|
|
|
+ }
|
|
|
if goods_art_floder_name not in error_goods_art_no_folder:
|
|
|
- finish_progress+=1
|
|
|
+ finish_progress += 1
|
|
|
sendAsyncMessage(
|
|
|
msg="正在处理",
|
|
|
goods_arts=[goods_art_floder_name],
|
|
|
@@ -721,11 +729,11 @@ class BaseDealImage(object):
|
|
|
break
|
|
|
error_progress = len(error_goods_art_no_folder)
|
|
|
progress = {
|
|
|
- "status":"处理完成",
|
|
|
- "current":finish_progress,
|
|
|
- "total":total_progress,
|
|
|
- "error":error_progress
|
|
|
- }
|
|
|
+ "status": "处理完成",
|
|
|
+ "current": finish_progress,
|
|
|
+ "total": total_progress,
|
|
|
+ "error": error_progress
|
|
|
+ }
|
|
|
if error_goods_art_no_folder:
|
|
|
print("以下货号抠图失败~\n {}".format(error_goods_art_no_folder))
|
|
|
callback_func("以下货号抠图失败~\n {}".format(error_goods_art_no_folder))
|
|
|
@@ -738,12 +746,6 @@ class BaseDealImage(object):
|
|
|
else:
|
|
|
pass
|
|
|
progress["status"] = "处理失败" if error_progress == total_progress else "处理完成"
|
|
|
- # sendAsyncMessage(
|
|
|
- # msg="抠图完成",
|
|
|
- # goods_arts=[],
|
|
|
- # status="抠图完成",
|
|
|
- # progress=progress
|
|
|
- # )
|
|
|
|
|
|
def checkCutoutImage(self, image_dir: str, todo_goods_art_no_folder_name_list=None):
|
|
|
"""
|
|
|
@@ -765,7 +767,7 @@ class BaseDealImage(object):
|
|
|
if "无法" in goods_art_no_folder:
|
|
|
continue
|
|
|
if "原始图" not in self.list_dir(
|
|
|
- "{}/{}".format(image_dir, goods_art_no_folder)
|
|
|
+ "{}/{}".format(image_dir, goods_art_no_folder)
|
|
|
):
|
|
|
error_goods_art_no_folder.append(goods_art_no_folder)
|
|
|
continue
|
|
|
@@ -869,15 +871,15 @@ class BaseDealImage(object):
|
|
|
print("550 文件夹重名命失败:{}".format(e))
|
|
|
|
|
|
def cutImagePiju(
|
|
|
- self,
|
|
|
- image_dir: str,
|
|
|
- image_order="",
|
|
|
- is_check_number=True,
|
|
|
- is_filter=True,
|
|
|
- resize_image_view="后跟",
|
|
|
- callback_func=None,
|
|
|
- event=None,
|
|
|
- todo_goods_art_no_folder_name_list=None,
|
|
|
+ self,
|
|
|
+ image_dir: str,
|
|
|
+ image_order="",
|
|
|
+ is_check_number=True,
|
|
|
+ is_filter=True,
|
|
|
+ resize_image_view="后跟",
|
|
|
+ callback_func=None,
|
|
|
+ event=None,
|
|
|
+ todo_goods_art_no_folder_name_list=None,
|
|
|
):
|
|
|
"""
|
|
|
1、遍历文件夹,基于生成的结果图看哪些需要进行抠图等处理
|
|
|
@@ -997,13 +999,13 @@ class BaseDealImage(object):
|
|
|
return {"code": 0, "msg": "ok"}
|
|
|
|
|
|
def run_one_folder_to_deal(
|
|
|
- self,
|
|
|
- goods_art_no_folder,
|
|
|
- image_dir,
|
|
|
- image_order,
|
|
|
- resize_image_view,
|
|
|
- callback_func=None,
|
|
|
- logo_path="",
|
|
|
+ self,
|
|
|
+ goods_art_no_folder,
|
|
|
+ image_dir,
|
|
|
+ image_order,
|
|
|
+ resize_image_view,
|
|
|
+ callback_func=None,
|
|
|
+ logo_path="",
|
|
|
):
|
|
|
|
|
|
_img_all = self.list_dir("{}/{}/原始图".format(image_dir, goods_art_no_folder))
|
|
|
@@ -1030,7 +1032,7 @@ class BaseDealImage(object):
|
|
|
all_original_images.append(new_file_name)
|
|
|
|
|
|
if os.path.exists(
|
|
|
- "{}/{}/原始图/镜像.txt".format(image_dir, goods_art_no_folder)
|
|
|
+ "{}/{}/原始图/镜像.txt".format(image_dir, goods_art_no_folder)
|
|
|
):
|
|
|
file_mirror_mark = True
|
|
|
else:
|
|
|
@@ -1112,7 +1114,7 @@ class BaseDealImage(object):
|
|
|
goods_class = "鞋"
|
|
|
# 如果图片已存在,则需要通过加载图片判断是否为左右脚
|
|
|
if OnePicDeal().check_shoe_is_right(
|
|
|
- image_path=original_move_bg_image_path
|
|
|
+ image_path=original_move_bg_image_path
|
|
|
):
|
|
|
image_deal_mode = 1 # 1表示要镜像,0表示不做镜像
|
|
|
is_image_deal_mode = 1
|
|
|
@@ -1191,24 +1193,24 @@ class BaseDealImage(object):
|
|
|
if settings.getSysConfigs(
|
|
|
"basic_configs", "main_image_size", [1600]
|
|
|
)
|
|
|
- == ""
|
|
|
+ == ""
|
|
|
else settings.getSysConfigs(
|
|
|
"basic_configs", "main_image_size", [1600]
|
|
|
)
|
|
|
) # 主图大小
|
|
|
if generate_pic.run(
|
|
|
- image_path=original_image_path,
|
|
|
- cut_image_path=original_move_bg_image_path,
|
|
|
- out_path=out_path,
|
|
|
- image_deal_mode=is_image_deal_mode,
|
|
|
- image_index=image_index,
|
|
|
- out_pic_size=out_pic_size,
|
|
|
- is_logo=True if i_n == 1 else False,
|
|
|
- out_process_path_1=out_process_path_1,
|
|
|
- out_process_path_2=out_process_path_2,
|
|
|
- max_box=max_box,
|
|
|
- logo_path=logo_path,
|
|
|
- curve_mask=curve_mask,
|
|
|
+ image_path=original_image_path,
|
|
|
+ cut_image_path=original_move_bg_image_path,
|
|
|
+ out_path=out_path,
|
|
|
+ image_deal_mode=is_image_deal_mode,
|
|
|
+ image_index=image_index,
|
|
|
+ out_pic_size=out_pic_size,
|
|
|
+ is_logo=True if i_n == 1 else False,
|
|
|
+ out_process_path_1=out_process_path_1,
|
|
|
+ out_process_path_2=out_process_path_2,
|
|
|
+ max_box=max_box,
|
|
|
+ logo_path=logo_path,
|
|
|
+ curve_mask=curve_mask,
|
|
|
):
|
|
|
# self.show_progress_detail("货号图{} _{} 已完成800*800图片制作~".format(image_index, file_name))
|
|
|
callback_func(
|
|
|
@@ -1248,7 +1250,7 @@ class BaseDealImage(object):
|
|
|
return None
|
|
|
|
|
|
def get_goods_art_no_info(
|
|
|
- self, numbers_list=None, goods_art_list=None, headers=None
|
|
|
+ self, numbers_list=None, goods_art_list=None, headers=None
|
|
|
):
|
|
|
# 获取商品基础信息,入参为商品的编号
|
|
|
url = "{domain}/api/backend/goods_client/goods_query".format(
|
|
|
@@ -1301,7 +1303,7 @@ class BaseDealImage(object):
|
|
|
return goods_art_no_dict
|
|
|
|
|
|
def get_goods_art_no_info(
|
|
|
- self, numbers_list=None, goods_art_list=None, headers=None
|
|
|
+ self, numbers_list=None, goods_art_list=None, headers=None
|
|
|
):
|
|
|
# 获取商品基础信息,入参为商品的编号
|
|
|
url = "{domain}/api/backend/goods_client/goods_query".format(
|
|
|
@@ -1572,7 +1574,7 @@ class BaseDealImage(object):
|
|
|
shutil.move(old_image_path, original_image_path)
|
|
|
|
|
|
def pixianRemoveImageBg(
|
|
|
- self, file_path: str, out_file_path: str, callbackek_func=None
|
|
|
+ self, file_path: str, out_file_path: str, callbackek_func=None
|
|
|
):
|
|
|
url = self.dataModeMatchPhoto.get_online_data.uploadImage(local_path=file_path)
|
|
|
|