diff --git a/old_to_new_build/tools_to_xmps.py b/old_to_new_build/tools_to_xmps.py index 3d1ccca..073efcd 100644 --- a/old_to_new_build/tools_to_xmps.py +++ b/old_to_new_build/tools_to_xmps.py @@ -165,16 +165,26 @@ def create_rate_xmps(pid): {libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \ {exportxmp} \ -exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \ - -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}"' + -exportRegistration "D://{pid}/xmps_reg/{pid}_registration.out" "D://make2/config/registration_export_config.xml" \ + -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit' print(cmd) cmd = shlex.split(cmd) res = subprocess.run(cmd) print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo2相机位姿完成,共费时{libs.diff_time(start_time)}') + #从 D://{pid}/xmps_reg/ 中获取对齐数量 + xmpAligns = 0 + for file in os.listdir(os.path.join(config.workdir, pid, 'xmps_reg')): + if file.endswith('.jpg'): + xmpAligns += 1 - upload_or_not = input('是否上传oss?(y/n)') - if upload_or_not == 'y': + #判断对齐数量是否和 照片总数一样 + if xmpAligns == (photos1_count+photos2_count): upload_xmp(pid) + else: + upload_or_not = input(f'当前照片总数{photos1_count+photos2_count},对齐数量{xmpAligns},没有全部对齐,是否上传oss?(y/n)') + 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)}')