Step3 插值算法 OOM 修复 + 多进程加速 + 全链路累积改动(14 文件)

This commit is contained in:
DXC
2026-06-15 16:49:17 +08:00
parent 82e0b92af6
commit 60a9d7d922
14 changed files with 855 additions and 152 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Step5 面板 - 光谱提取
Step6 面板 - 光谱特征提取
"""
import os
@ -27,7 +27,7 @@ class Step6FeaturePanel(QWidget):
layout = QVBoxLayout()
# 标题
title = QLabel("步骤5训练样本光谱提取")
title = QLabel("步骤6光谱特征提取")
title.setFont(QFont("Arial", 12, QFont.Bold))
layout.addWidget(title)
@ -58,12 +58,12 @@ class Step6FeaturePanel(QWidget):
"Mask Files (*.dat *.tif);;All Files (*.*)"
)
layout.addWidget(self.glint_mask_file)
step5_glint_hint = QLabel(
step6_glint_hint = QLabel(
"提示独立运行本步骤时必须选择耀斑掩膜通常为步骤2输出的 severe_glint_area.dat用于在采样时避开耀斑像元。"
)
step5_glint_hint.setWordWrap(True)
step5_glint_hint.setStyleSheet("color: #666; font-size: 10px;")
layout.addWidget(step5_glint_hint)
step6_glint_hint.setWordWrap(True)
step6_glint_hint.setStyleSheet("color: #666; font-size: 10px;")
layout.addWidget(step6_glint_hint)
# 参数设置
params_group = QGroupBox("提取参数")
@ -200,20 +200,22 @@ class Step6FeaturePanel(QWidget):
else:
self.output_file.set_path("")
# 5. 尝试从 Step4 界面读取已处理的水质参数 CSV 路径,自动填入本面板
# 5. 尝试从 Step5 Clean 界面读取已处理的清洗后 CSV 路径,自动填入本面板
main_window = self.window()
if main_window and hasattr(main_window, 'step5_panel'):
step4_output_path = main_window.step5_panel.output_file.get_path()
if step4_output_path:
if main_window and hasattr(main_window, 'step5_clean_panel'):
step5_clean_output_path = main_window.step5_clean_panel.output_file.get_path()
if step5_clean_output_path:
# 若为相对路径,使用 work_dir 合成为绝对路径
if not os.path.isabs(step4_output_path):
step4_output_path = os.path.join(self.work_dir or '', step4_output_path).replace('\\', '/')
if not os.path.isabs(step5_clean_output_path):
step5_clean_output_path = os.path.join(
self.work_dir or '', step5_clean_output_path
).replace('\\', '/')
existing_csv = self.csv_file.get_path()
if not existing_csv or not existing_csv.strip():
self.csv_file.set_path(step4_output_path)
self.csv_file.set_path(step5_clean_output_path)
def run_step(self):
"""独立运行步骤5"""
"""独立运行步骤6"""
# 验证输入
deglint_img_path = self.deglint_img_file.get_path()
csv_path = self.csv_file.get_path()