修bug
This commit is contained in:
parent
54ed939dc7
commit
d0cd9de0e2
@ -82,7 +82,7 @@ class ImagePreprocessor:
|
|||||||
os.makedirs(self.config.output_dir)
|
os.makedirs(self.config.output_dir)
|
||||||
|
|
||||||
# 创建过滤图像保存目录
|
# 创建过滤图像保存目录
|
||||||
os.makedirs(os.path.join(self.config.output_dir, 'filter_imgs'))
|
os.makedirs(os.path.join(self.config.output_dir, 'filter_imgs_visual'))
|
||||||
|
|
||||||
# 创建日志目录
|
# 创建日志目录
|
||||||
os.makedirs(os.path.join(self.config.output_dir, 'logs'))
|
os.makedirs(os.path.join(self.config.output_dir, 'logs'))
|
||||||
|
@ -129,7 +129,7 @@ class GridDivider:
|
|||||||
# 如果提供了输出目录,保存图像
|
# 如果提供了输出目录,保存图像
|
||||||
if self.output_dir:
|
if self.output_dir:
|
||||||
save_path = os.path.join(
|
save_path = os.path.join(
|
||||||
self.output_dir, 'filter_imgs', 'grid_division.png')
|
self.output_dir, 'filter_imgs_visual', 'grid_division.png')
|
||||||
plt.savefig(save_path, dpi=300, bbox_inches='tight')
|
plt.savefig(save_path, dpi=300, bbox_inches='tight')
|
||||||
self.logger.info(f"网格划分可视化图已保存至: {save_path}")
|
self.logger.info(f"网格划分可视化图已保存至: {save_path}")
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ class ODMProcessMonitor:
|
|||||||
self.logger = logging.getLogger('UAV_Preprocess.ODMMonitor')
|
self.logger = logging.getLogger('UAV_Preprocess.ODMMonitor')
|
||||||
self.fast_mode = fast_mode
|
self.fast_mode = fast_mode
|
||||||
|
|
||||||
def _check_success(self, grid_dir: str) -> bool:
|
def _check_success(self, project_dir: str) -> bool:
|
||||||
"""检查ODM是否执行成功"""
|
"""检查ODM是否执行成功"""
|
||||||
success_markers = ['odm_orthophoto', 'odm_georeferencing']
|
success_markers = ['odm_orthophoto', 'odm_georeferencing']
|
||||||
if not self.fast_mode:
|
if not self.fast_mode:
|
||||||
success_markers.append('odm_texturing')
|
success_markers.append('odm_texturing')
|
||||||
return all(os.path.exists(os.path.join(grid_dir, 'project', marker)) for marker in success_markers)
|
return all(os.path.exists(os.path.join(project_dir, 'project', marker)) for marker in success_markers)
|
||||||
|
|
||||||
def run_odm_with_monitor(self, project_dir: str, fast_mode: bool = True) -> Tuple[bool, str]:
|
def run_odm_with_monitor(self, project_dir: str, fast_mode: bool = True) -> Tuple[bool, str]:
|
||||||
"""运行ODM命令"""
|
"""运行ODM命令"""
|
||||||
@ -51,7 +51,7 @@ class ODMProcessMonitor:
|
|||||||
self.logger.info(f"==========stdout==========: {stdout}")
|
self.logger.info(f"==========stdout==========: {stdout}")
|
||||||
self.logger.error(f"==========stderr==========: {stderr}")
|
self.logger.error(f"==========stderr==========: {stderr}")
|
||||||
# 检查执行结果
|
# 检查执行结果
|
||||||
if self._check_success(image_dir):
|
if self._check_success(project_dir):
|
||||||
self.logger.info(f"处理成功")
|
self.logger.info(f"处理成功")
|
||||||
else:
|
else:
|
||||||
self.logger.error(f"处理失败")
|
self.logger.error(f"处理失败")
|
||||||
|
Loading…
Reference in New Issue
Block a user