添加可选参数
This commit is contained in:
parent
cfa04d934f
commit
1685f8c951
@ -30,6 +30,10 @@ class ProcessConfig:
|
||||
|
||||
mode: str = "三维模式"
|
||||
|
||||
# ODM参数
|
||||
feature_type: str = "sift"
|
||||
orthophoto_resolution: float = 5
|
||||
|
||||
|
||||
class ODM_Plugin:
|
||||
def __init__(self, config):
|
||||
@ -47,7 +51,7 @@ class ODM_Plugin:
|
||||
self.logger = setup_logger(config.output_dir)
|
||||
self.gps_points = pd.DataFrame(columns=["file", "lat", "lon"])
|
||||
self.odm_monitor = ODMProcessMonitor(
|
||||
config.output_dir, mode=config.mode)
|
||||
config.output_dir, mode=config.mode, config=config)
|
||||
self.visualizer = FilterVisualizer(config.output_dir)
|
||||
|
||||
def extract_gps(self) -> pd.DataFrame:
|
||||
|
7
main.py
7
main.py
@ -18,6 +18,11 @@ def parse_args():
|
||||
parser.add_argument('--grid_overlap', type=float,
|
||||
default=0.1, help='网格重叠率')
|
||||
|
||||
# ODM参数
|
||||
parser.add_argument('--feature_type', default='sift', help='特征类型')
|
||||
parser.add_argument('--orthophoto_resolution',
|
||||
type=float, default=5, help='正射影像分辨率')
|
||||
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
@ -32,6 +37,8 @@ def main():
|
||||
mode=args.mode,
|
||||
grid_size=args.grid_size,
|
||||
grid_overlap=args.grid_overlap,
|
||||
feature_type=args.feature_type,
|
||||
orthophoto_resolution=args.orthophoto_resolution,
|
||||
|
||||
# 其他参数使用默认值
|
||||
cluster_eps=0.01,
|
||||
|
@ -9,10 +9,11 @@ import docker
|
||||
class ODMProcessMonitor:
|
||||
"""ODM处理监控器"""
|
||||
|
||||
def __init__(self, output_dir: str, mode: str = "三维模式"):
|
||||
def __init__(self, output_dir: str, mode: str = "三维模式", config=None):
|
||||
self.output_dir = output_dir
|
||||
self.logger = logging.getLogger('UAV_Preprocess.ODMMonitor')
|
||||
self.mode = mode
|
||||
self.config = config
|
||||
|
||||
def run_odm_with_monitor(self, grid_dir: str, grid_id: tuple) -> Tuple[bool, str]:
|
||||
"""运行ODM命令"""
|
||||
@ -45,12 +46,13 @@ class ODMProcessMonitor:
|
||||
f"--use-hybrid-bundle-adjustment "
|
||||
f"--optimize-disk-space "
|
||||
f"--orthophoto-cutline "
|
||||
f"--feature-type sift "
|
||||
f"--orthophoto-resolution 1.5 "
|
||||
# f"--mesh-size 5000000 "
|
||||
# f"--mesh-octree-depth 13 "
|
||||
)
|
||||
|
||||
command += f"--feature-type {self.config.feature_type} "
|
||||
command += f"--orthophoto-resolution {self.config.orthophoto_resolution} "
|
||||
|
||||
if self.mode == "快拼模式":
|
||||
command += (
|
||||
f"--fast-orthophoto "
|
||||
@ -61,10 +63,10 @@ class ODMProcessMonitor:
|
||||
f"--dsm "
|
||||
f"--dtm "
|
||||
)
|
||||
# if current_try == 1:
|
||||
# command += (
|
||||
# f"--feature-quality low "
|
||||
# )
|
||||
if current_try == 1:
|
||||
command += (
|
||||
f"--feature-quality low "
|
||||
)
|
||||
|
||||
command += "--rerun-all"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user