fix(step7): 消除UnboundLocalError — 将Path/os导入上移至函数第一行,避免与后续局部赋值冲突
This commit is contained in:
@ -28,6 +28,7 @@ class PredictionStep:
|
|||||||
callback: Optional[Callable] = None,
|
callback: Optional[Callable] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""生成水域掩膜内且耀斑掩膜外的采样点,统计平均光谱"""
|
"""生成水域掩膜内且耀斑掩膜外的采样点,统计平均光谱"""
|
||||||
|
from pathlib import Path
|
||||||
from src.utils.sampling import get_spectral_sampling_points_chunked
|
from src.utils.sampling import get_spectral_sampling_points_chunked
|
||||||
|
|
||||||
output_dir = Path(output_dir)
|
output_dir = Path(output_dir)
|
||||||
@ -47,9 +48,6 @@ class PredictionStep:
|
|||||||
if deglint_img_path is None:
|
if deglint_img_path is None:
|
||||||
raise ValueError("必须提供 deglint_img_path 参数")
|
raise ValueError("必须提供 deglint_img_path 参数")
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import os
|
|
||||||
|
|
||||||
# 1. 初始归一化与安全转换
|
# 1. 初始归一化与安全转换
|
||||||
original_path = Path(deglint_img_path)
|
original_path = Path(deglint_img_path)
|
||||||
final_deglint_path = original_path
|
final_deglint_path = original_path
|
||||||
|
|||||||
Reference in New Issue
Block a user