|
|
|
|
@ -3,7 +3,7 @@ import os, oss2, time, redis, requests, shutil, sys, subprocess, json, platform
@@ -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_v1 |
|
|
|
|
import white_purification_v2,white_purification |
|
|
|
|
if platform.system() == 'Windows': |
|
|
|
|
sys.path.append('e:\\libs\\') |
|
|
|
|
import common |
|
|
|
|
@ -124,17 +124,7 @@ def team_check(r):
@@ -124,17 +124,7 @@ def team_check(r):
|
|
|
|
|
|
|
|
|
|
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,pid+"Tex1.jpg") |
|
|
|
|
print("开始处理白色提纯") |
|
|
|
|
#white_purification_v1.white_purification_utils(imagePath) |
|
|
|
|
os.system(f'python d:\\make2\\apps\white_purification_v1.py.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' |
|
|
|
|
@ -158,6 +148,20 @@ def team_check(r):
@@ -158,6 +148,20 @@ def team_check(r):
|
|
|
|
|
|
|
|
|
|
oss_client.put_object_from_file(f'glbs/print/order_id/{glb_filename}', os.path.join(workdir, "print", pid, glb_filename)) |
|
|
|
|
|
|
|
|
|
#对文件进行白色提纯处理 |
|
|
|
|
imagePath = os.path.join(workdir, 'print', pid,pid+"Tex1.jpg") |
|
|
|
|
print("开始处理白色提纯") |
|
|
|
|
#white_purification.white_purification_utils(imagePath) |
|
|
|
|
os.system(f'python D:\\make2\\apps\white_purification_v2.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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
|
res = requests.get(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
|
print('更新团队审核状态:', res.text) |
|
|
|
|
|