From 32ccba4db6863d0b459b7d82793b7f0fd54fe49c Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Thu, 10 Jul 2025 17:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/auto_convert3d_new.py | 2 +- apps/auto_convert3d_test.py | 35 +++++++++++-------- apps/remove_light_fix_up_shadow_dream_tech.py | 4 +-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/apps/auto_convert3d_new.py b/apps/auto_convert3d_new.py index e67b68e..626c9cd 100644 --- a/apps/auto_convert3d_new.py +++ b/apps/auto_convert3d_new.py @@ -131,7 +131,7 @@ def team_check(r): #对文件进行白色提纯处理 imagePath = os.path.join(workdir, 'print', pid,orderId,pid+"Tex1.jpg") - print("开始处理白色提纯") + print("开始处理白色提纯,门店id",shopId) #white_purification.white_purification_utils(imagePath) if shopId == "240": os.system(f'python D:\\make2\\apps\\remove_light_fix_up_shadow_dream_tech.py -input_path {imagePath} -output_path {imagePath}') diff --git a/apps/auto_convert3d_test.py b/apps/auto_convert3d_test.py index 0ec0cd1..9e0830e 100644 --- a/apps/auto_convert3d_test.py +++ b/apps/auto_convert3d_test.py @@ -3,7 +3,7 @@ import os, oss2, time, redis, requests, shutil, sys, subprocess, json, platform from PIL import Image, ImageDraw, ImageFont from retrying import retry import atexit,platform -import white_purification_v4,white_purification +import white_purification_v4,white_purification,remove_light_fix_up_shadow_dream_tech if platform.system() == 'Windows': sys.path.append('e:\\libs\\') import common @@ -68,8 +68,6 @@ def down_obj_fromoss(pid,order_id): localfile = os.path.join(path, filename) if "process" in file.key or "human" in file.key: continue - - res = oss_client.get_object_to_file(file.key, localfile) print(f'下载文件:{file.key},状态:{res.status}') @@ -116,19 +114,36 @@ def team_check(r): # if repair_id is None: return # repair_id = repair_id.decode('utf-8') - repair_id = "66682" + repair_id = "67404" res = requests.get(f'{getRepairInfo_url}?id={repair_id}') print(f'getRepairInfo_url:{getRepairInfo_url}?id={repair_id}') print(res.text) pid = res.json()['data']['pid'] orderId = res.json()['data']['order_id'] + shopId = res.json()['data']['shop_id'] pid = str(pid) orderId = str(orderId) + shopId = str(shopId) #print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} repair_id:{repair_id} 生成团队审核模型 start model:IndependentRepairTeamcheckGLBQueue', ) ossPath = down_obj_fromoss(pid,orderId) + #对文件进行白色提纯处理 + imagePath = os.path.join(workdir, 'print', pid,orderId,pid+"Tex1.jpg") + print("开始处理白色提纯,门店id",shopId) + #white_purification.white_purification_utils(imagePath) + if shopId == "240": + print(f'python D:\\make2\\apps\\remove_light_fix_up_shadow_dream_tech.py -input_path {imagePath} -output_path {imagePath}') + os.system(f'python D:\\make2\\apps\\remove_light_fix_up_shadow_dream_tech.py -input_path {imagePath} -output_path {imagePath}') + else: + os.system(f'python D:\\make2\\apps\\white_purification.py -i {imagePath}') + + print("贴图文件白色提纯完成",imagePath) + #提纯完重新上传提纯图片 + ossImagePath = os.path.join("objs/print", pid,ossPath,"texture","process_"+pid+"Tex1.jpg") + oss_client.put_object_from_file(f"objs/print/{pid}/{ossPath}/texture/process_{pid}Tex1.jpg",imagePath) + print("白色提纯上传图片路径-",ossImagePath,imagePath) obj_filename = f'{pid}.obj' glb_filename = f'{orderId}.glb' @@ -152,17 +167,7 @@ def team_check(r): oss_client.put_object_from_file(f'glbs/print/order_id/{glb_filename}', os.path.join(workdir, "print", pid,orderId, glb_filename)) - #对文件进行白色提纯处理 - imagePath = os.path.join(workdir, 'print', pid,orderId,pid+"Tex1.jpg") - print("开始处理白色提纯") - #white_purification.white_purification_utils(imagePath) - os.system(f'python D:\\make2\\apps\white_purification_v4.py -i {imagePath}') - - print("贴图文件白色提纯完成",imagePath) - #提纯完重新上传提纯图片 - ossImagePath = os.path.join("objs/print", pid,ossPath,"texture","process_"+pid+"Tex1.jpg") - oss_client.put_object_from_file(f"objs/print/{pid}/{ossPath}/texture/process_{pid}Tex1.jpg",imagePath) - print("白色提纯上传图片路径-",ossImagePath,imagePath) + diff --git a/apps/remove_light_fix_up_shadow_dream_tech.py b/apps/remove_light_fix_up_shadow_dream_tech.py index 6e07697..780fab5 100644 --- a/apps/remove_light_fix_up_shadow_dream_tech.py +++ b/apps/remove_light_fix_up_shadow_dream_tech.py @@ -332,8 +332,8 @@ def correct_texture_image(input_path,image_result_dir,output_path): if __name__ == "__main__": arg = argparse.ArgumentParser() - arg.add_argument('--input_path', type=str, default=f"") - arg.add_argument('--output_path', type=str, default=f"") + arg.add_argument('-input_path', type=str, default=f"") + arg.add_argument('-output_path', type=str, default=f"") args = arg.parse_args() image_result_dir=os.path.dirname(args.output_path) os.makedirs(image_result_dir, exist_ok=True)