新影棚也需要进行xmps 共享
This commit is contained in:
1 parent
0554de8211
commit
d51cc017a1
2 files changed
+14
-15
No files matched your search
@@ -27,8 +27,8 @@ def get_xmps(psid,pid):
|
||||
if file.key.endswith('.xmp'):
|
||||
filename = file.key.split('/')[-1]
|
||||
print('正在下载:', file.key)
|
||||
# os.makedirs(os.path.join(config.sharedir, 'xmps_new_studio_rate', psid, 'texture'), exist_ok=True)
|
||||
config.oss_bucket.get_object_to_file(file.key, os.path.join(config.sharedir,'xmps_new_studio_rate', 'texture', filename))
|
||||
os.makedirs(os.path.join(config.sharedir, 'xmps_new_studio_rate', psid, 'texture'), exist_ok=True)
|
||||
config.oss_bucket.get_object_to_file(file.key, os.path.join(config.sharedir,'xmps_new_studio_rate',psid, 'texture', filename))
|
||||
|
||||
#将共享盘的对齐信息复制到工作目录,photo1 和 photo2
|
||||
# shutil.copytree(os.path.join(config.sharedir, 'xmps_new_studio_rate', psid, 'mesh'), os.path.join(config.workdir, pid, 'photo1'),dirs_exist_ok=True)
|
||||
@@ -44,7 +44,6 @@ def get_xmps(psid,pid):
|
||||
def get_photo2_align_info(pid):
|
||||
pid = str(pid)
|
||||
psid = libs.getPSid(pid)
|
||||
|
||||
#判断是否存在该目录
|
||||
if os.path.exists(os.path.join(config.workdir, pid)) == False:
|
||||
#下载照片
|
||||
@@ -60,16 +59,16 @@ def get_photo2_align_info(pid):
|
||||
photosNums = len(os.listdir(os.path.join(config.workdir, pid, "photo2")))
|
||||
#判断是否存在该目录
|
||||
print(f"影棚号:{psid} , {config.oss_bucket.object_exists(f'xmps_new_studio_rate/{psid}/')}")
|
||||
#filename = f'xmps_new_studio_rate/{psid}/{psid}.rcbox'
|
||||
filename = f'xmps_new_studio_rate/{psid}/{psid}.rcbox'
|
||||
isRate = False
|
||||
# if not config.oss_bucket.object_exists(filename):
|
||||
# #提示是否进行 xmps_new_studio_rate 文件夹的创建
|
||||
# yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)')
|
||||
# if yes_or_not == 'y':
|
||||
# tools_to_xmps.create_rate_xmps(pid)
|
||||
# isRate = True
|
||||
# else:
|
||||
# sys.exit(0)
|
||||
if not config.oss_bucket.object_exists(filename):
|
||||
#提示是否进行 xmps_new_studio_rate 文件夹的创建
|
||||
yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)')
|
||||
if yes_or_not == 'y':
|
||||
tools_to_xmps.create_rate_xmps(pid)
|
||||
isRate = True
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
#旋转图片
|
||||
if isRate == False:
|
||||
@@ -77,7 +76,7 @@ def get_photo2_align_info(pid):
|
||||
tools_to_xmps.rateImages(pid)
|
||||
|
||||
#下载对齐信息
|
||||
#get_xmps(psid,pid)
|
||||
get_xmps(psid,pid)
|
||||
|
||||
#执行对齐指令
|
||||
cmd = f'{config.rcbin} {config.r2["init"]} -setInstanceName {pid} \
|
||||
|
||||
@@ -122,7 +122,7 @@ def create_rate_xmps(pid):
|
||||
|
||||
#photos1_count = len(os.listdir(photo1_path))
|
||||
photos2_count = len(os.listdir(photo2_path))
|
||||
if photos2_count < 21:
|
||||
if photos2_count < 22:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo2数量{photos2_count},未能覆盖所有相机,是否继续计算相机位姿?')
|
||||
continue_or_not = input('是否继续计算相机位姿?(y/n)')
|
||||
if continue_or_not == 'y':
|
||||
@@ -169,7 +169,7 @@ def create_rate_xmps(pid):
|
||||
if upload_or_not == 'y':
|
||||
upload_xmp(pid)
|
||||
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} rate_xmps文件生成完成,共费时{libs.diff_time(start_time)}')
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmps_new_studio_rate文件生成完成,共费时{libs.diff_time(start_time)}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in new issue
Block a user