原始的step1 2 3 和 manual
This commit is contained in:
1 parent
3fa8457411
commit
ecb58b2f59
4 files changed
+25
-4
No files matched your search
@@ -108,6 +108,19 @@ def step1(pid, experience=False, makeloop=True,task_distributed_id="",isNoColorT
|
|||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 开始下载图片...')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 开始下载图片...')
|
||||||
libs.down_from_oss(config.oss_bucket, config.workdir, pid)
|
libs.down_from_oss(config.oss_bucket, config.workdir, pid)
|
||||||
|
try:
|
||||||
|
if str(psid) == "86":
|
||||||
|
#移除指定文件
|
||||||
|
os.remove(f"D:\{pid}\photo1\\21_1.jpg")
|
||||||
|
os.remove(f"D:\{pid}\photo2\\21_8.jpg")
|
||||||
|
if str(psid) == "29":
|
||||||
|
#移除指定文件
|
||||||
|
os.remove(f"D:\{pid}\photo1\\15_1.jpg")
|
||||||
|
os.remove(f"D:\{pid}\photo2\\15_8.jpg")
|
||||||
|
except Exception as e:
|
||||||
|
print("移除异常")
|
||||||
|
|
||||||
|
|
||||||
os.system(f'python tools/downxmps.py {pid}')
|
os.system(f'python tools/downxmps.py {pid}')
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 图片下载完成,共费时{libs.diff_time(start_time)}')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 图片下载完成,共费时{libs.diff_time(start_time)}')
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -6,7 +6,7 @@ if platform.system() == 'Windows':
|
|||||||
#sys.path.append('libs')
|
#sys.path.append('libs')
|
||||||
else:
|
else:
|
||||||
sys.path.append('/data/deploy/make3d/make2/libs/')
|
sys.path.append('/data/deploy/make3d/make2/libs/')
|
||||||
import config, libs, libs_db,main_service_db,common,foot_mark_seam
|
import config, libs, libs_db,main_service_db,common,foot_mark_seam,libs_db_gpu
|
||||||
|
|
||||||
def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifiers=False):
|
def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifiers=False):
|
||||||
"""Returns a transformed, triangulated copy of the mesh"""
|
"""Returns a transformed, triangulated copy of the mesh"""
|
||||||
@@ -207,6 +207,12 @@ def step3(pid,task_distributed_id=""):
|
|||||||
resize_texture_and_reload_obj(pid)
|
resize_texture_and_reload_obj(pid)
|
||||||
export_and_update_glbs(pid)
|
export_and_update_glbs(pid)
|
||||||
|
|
||||||
|
#向gpu数据库task 插入任务,用于开始执行AI修模
|
||||||
|
headcount = libs.getHeadCount(pid)
|
||||||
|
#if headcount == 1:
|
||||||
|
libs_db_gpu.add_task(data={"pid":pid,"cut_body":"face","heads":headcount})
|
||||||
|
|
||||||
|
|
||||||
# 更新本地任务状态,更新云端任务状态
|
# 更新本地任务状态,更新云端任务状态
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 模型后道处理完成,共费时{libs.diff_time(start_time)}')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 模型后道处理完成,共费时{libs.diff_time(start_time)}')
|
||||||
res = requests.post(config.urls['update_status_modelsuccess_url'], data={'id': pid})
|
res = requests.post(config.urls['update_status_modelsuccess_url'], data={'id': pid})
|
||||||
|
|||||||
+4
-2
@@ -68,7 +68,7 @@ def cmd_run(pid,usePhoto = "1",lock=False):
|
|||||||
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" \
|
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" \
|
||||||
-addFolder "{os.path.join(config.workdir, pid, usePhoto)}" -selectAllImages \
|
-addFolder "{os.path.join(config.workdir, pid, usePhoto)}" -selectAllImages \
|
||||||
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
||||||
-align -align \
|
-align -align -align -align \
|
||||||
{exportxmp} \
|
{exportxmp} \
|
||||||
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit'
|
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit'
|
||||||
print(cmd)
|
print(cmd)
|
||||||
@@ -90,6 +90,8 @@ def cmd_run(pid,usePhoto = "1",lock=False):
|
|||||||
if usePhoto == "photo2":
|
if usePhoto == "photo2":
|
||||||
shutil.copy(os.path.join(sourceFile, xmp), os.path.join(targetFile,xmp.replace('_8.xmp', '_1.xmp')))
|
shutil.copy(os.path.join(sourceFile, xmp), os.path.join(targetFile,xmp.replace('_8.xmp', '_1.xmp')))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#如果是photo2的话,就要将photo2 的 xmp 重命名成 _8.xmp
|
#如果是photo2的话,就要将photo2 的 xmp 重命名成 _8.xmp
|
||||||
# if usePhoto == "photo2":
|
# if usePhoto == "photo2":
|
||||||
# for xmp in os.listdir(sourceFile):
|
# for xmp in os.listdir(sourceFile):
|
||||||
@@ -105,7 +107,7 @@ def cmd_run(pid,usePhoto = "1",lock=False):
|
|||||||
-load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" {config.r["setTextureFalse"]} \
|
-load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" {config.r["setTextureFalse"]} \
|
||||||
-addFolder "{targetFile}" -selectAllImages \
|
-addFolder "{targetFile}" -selectAllImages \
|
||||||
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
||||||
{libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \
|
{libs.get_defineDistances(psid)} -update -align -align -align -align {config.r2["setRegion"]} \
|
||||||
{exportxmp} \
|
{exportxmp} \
|
||||||
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \
|
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \
|
||||||
-selectImage "{os.path.join(config.workdir,pid,"photo2")}/*" -enableTexturingAndColoring true \
|
-selectImage "{os.path.join(config.workdir,pid,"photo2")}/*" -enableTexturingAndColoring true \
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ def cmd_run(pid,usePhoto = "2",lock=False):
|
|||||||
cmd = f'{config.rcbin} -setInstanceName {pid} \
|
cmd = f'{config.rcbin} -setInstanceName {pid} \
|
||||||
-load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}"\
|
-load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}"\
|
||||||
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
||||||
{libs.get_defineDistances(psid)} -update -align -align -align -align -align -align {config.r2["setRegion"]} \
|
{libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \
|
||||||
{exportxmp} \
|
{exportxmp} \
|
||||||
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \
|
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \
|
||||||
-selectImage "{os.path.join(config.workdir,pid,"photo2")}/*" -enableTexturingAndColoring true \
|
-selectImage "{os.path.join(config.workdir,pid,"photo2")}/*" -enableTexturingAndColoring true \
|
||||||
|
|||||||
Reference in new issue
Block a user