修复bug
This commit is contained in:
parent
382a269831
commit
0e8fb34e7a
@ -16,7 +16,4 @@ conda install -c conda-forge open3d
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- command_runner中rerun需要更新
|
|
||||||
- grid要动态分割大小
|
|
||||||
- 任务队列
|
|
||||||
- 目前obj转osgb的软件windows没有装上,linux成功了,后续需要做一个docker镜像
|
- 目前obj转osgb的软件windows没有装上,linux成功了,后续需要做一个docker镜像
|
2
main.py
2
main.py
@ -11,7 +11,7 @@ def parse_args():
|
|||||||
|
|
||||||
# 可选参数
|
# 可选参数
|
||||||
parser.add_argument('--mode', default='重建模式', choices=['快拼模式', '三维模式', '重建模式'], help='处理模式')
|
parser.add_argument('--mode', default='重建模式', choices=['快拼模式', '三维模式', '重建模式'], help='处理模式')
|
||||||
parser.add_argument('--grid_size', type=float, default=1000, help='网格大小(米)')
|
parser.add_argument('--grid_size', type=float, default=800, help='网格大小(米)')
|
||||||
parser.add_argument('--grid_overlap', type=float, default=0.05, help='网格重叠率')
|
parser.add_argument('--grid_overlap', type=float, default=0.05, help='网格重叠率')
|
||||||
parser.add_argument('--produce_dem', action='store_true', help='是否生成DEM')
|
parser.add_argument('--produce_dem', action='store_true', help='是否生成DEM')
|
||||||
|
|
||||||
|
@ -68,7 +68,6 @@ class ImagePreprocessor:
|
|||||||
config.output_dir, mode=config.mode)
|
config.output_dir, mode=config.mode)
|
||||||
self.visualizer = FilterVisualizer(config.output_dir)
|
self.visualizer = FilterVisualizer(config.output_dir)
|
||||||
|
|
||||||
# TODO 给出警告!
|
|
||||||
def _clean_output_dir(self):
|
def _clean_output_dir(self):
|
||||||
"""清理输出目录"""
|
"""清理输出目录"""
|
||||||
try:
|
try:
|
||||||
|
@ -128,6 +128,17 @@ class MergeTif:
|
|||||||
f"网格 ({grid_id[0]},{grid_id[1]}) 的{product_name}不存在: {grid_tif}")
|
f"网格 ({grid_id[0]},{grid_id[1]}) 的{product_name}不存在: {grid_tif}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# 如果文件大于600MB,则不使用original文件
|
||||||
|
file_size_mb = os.path.getsize(grid_tif) / (1024 * 1024) # 转换为MB
|
||||||
|
if file_size_mb > 600:
|
||||||
|
grid_tif = os.path.join(
|
||||||
|
self.output_dir,
|
||||||
|
f"grid_{grid_id[0]}_{grid_id[1]}",
|
||||||
|
"project",
|
||||||
|
product_path,
|
||||||
|
"odm_orthophoto.tif"
|
||||||
|
)
|
||||||
|
|
||||||
if input_tif1 is None:
|
if input_tif1 is None:
|
||||||
input_tif1 = grid_tif
|
input_tif1 = grid_tif
|
||||||
self.logger.info(f"设置第一个输入{product_name}: {input_tif1}")
|
self.logger.info(f"设置第一个输入{product_name}: {input_tif1}")
|
||||||
|
@ -39,8 +39,8 @@ class ODMProcessMonitor:
|
|||||||
elif self.mode == "三维模式":
|
elif self.mode == "三维模式":
|
||||||
# 检查点云和实景三维
|
# 检查点云和实景三维
|
||||||
if not all([
|
if not all([
|
||||||
os.path.exists(os.path.join(project_dir, 'odm_georeferencing')),
|
os.path.exists(os.path.join(project_dir, 'odm_georeferencing', 'odm_georeferenced_model.laz')),
|
||||||
os.path.exists(os.path.join(project_dir, 'odm_texturing'))
|
os.path.exists(os.path.join(project_dir, 'odm_texturing', 'odm_textured_model_geo.obj'))
|
||||||
]):
|
]):
|
||||||
self.logger.error("点云或实景三维文件夹未生成")
|
self.logger.error("点云或实景三维文件夹未生成")
|
||||||
return False
|
return False
|
||||||
@ -50,9 +50,8 @@ class ODMProcessMonitor:
|
|||||||
elif self.mode == "重建模式":
|
elif self.mode == "重建模式":
|
||||||
# 检查所有产品
|
# 检查所有产品
|
||||||
if not all([
|
if not all([
|
||||||
os.path.exists(os.path.join(project_dir, 'odm_orthophoto')),
|
os.path.exists(os.path.join(project_dir, 'odm_georeferencing', 'odm_georeferenced_model.laz')),
|
||||||
os.path.exists(os.path.join(project_dir, 'odm_georeferencing')),
|
os.path.exists(os.path.join(project_dir, 'odm_texturing', 'odm_textured_model_geo.obj'))
|
||||||
os.path.exists(os.path.join(project_dir, 'odm_texturing'))
|
|
||||||
]):
|
]):
|
||||||
self.logger.error("部分必要的文件夹未生成")
|
self.logger.error("部分必要的文件夹未生成")
|
||||||
return False
|
return False
|
||||||
@ -65,6 +64,7 @@ class ODMProcessMonitor:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# TODO 正射影像怎么检查最好
|
||||||
def _check_orthophoto(self, project_dir: str) -> bool:
|
def _check_orthophoto(self, project_dir: str) -> bool:
|
||||||
"""检查正射影像的质量"""
|
"""检查正射影像的质量"""
|
||||||
ortho_path = os.path.join(project_dir, 'odm_orthophoto', 'odm_orthophoto.original.tif')
|
ortho_path = os.path.join(project_dir, 'odm_orthophoto', 'odm_orthophoto.original.tif')
|
||||||
@ -197,7 +197,6 @@ class ODMProcessMonitor:
|
|||||||
else:
|
else:
|
||||||
error_msg = "Docker运行失败,需要人工排查错误"
|
error_msg = "Docker运行失败,需要人工排查错误"
|
||||||
break
|
break
|
||||||
# TODO 处理时间组删除,删多了的情况
|
|
||||||
else:
|
else:
|
||||||
self.logger.info("docker run指令执行成功")
|
self.logger.info("docker run指令执行成功")
|
||||||
if "ODM app finished" in last_lines:
|
if "ODM app finished" in last_lines:
|
||||||
|
Loading…
Reference in New Issue
Block a user