Expand Seg task coverage and coverage dashboard

This commit is contained in:
2026-06-30 12:54:25 +08:00
parent dd7b7384ec
commit 7a43303f15
18 changed files with 849 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
from ...commands import CommandSpec, append_flag, conda_python, required
from ...commands import CommandSpec, append_flag, bash, conda_python, required
from ...config import settings
@@ -49,6 +49,12 @@ def build_mmseg_task(job_type: str, params: dict, conda_env: str) -> CommandSpec
if job_type == "mmseg.generate_data":
return CommandSpec(conda_python(conda_env, MY_DIR / "1_Initial_Data_All_data_from_1_Data_Parameter-V2.py"), MMSEG_DIR, "generate MMSeg dataset configs from JSON parameters")
if job_type == "mmseg.generate_data_v1":
return CommandSpec(conda_python(conda_env, MY_DIR / "1_Initial_Data_All_data_from_1_Data_Parameter-V1.py"), MMSEG_DIR, "generate MMSeg dataset configs with V1 flow")
if job_type == "mmseg.generate_data_legacy":
return CommandSpec(conda_python(conda_env, MY_DIR / "1_Initial_Data_All-ori.py"), MMSEG_DIR, "run legacy original MMSeg dataset config generator")
if job_type == "mmseg.generate_alg":
script = MY_DIR / "2_Initial_Alg_All_data_from_2_Alg_Program-V2.py"
return CommandSpec(
@@ -58,6 +64,18 @@ def build_mmseg_task(job_type: str, params: dict, conda_env: str) -> CommandSpec
stdin_text=_stdin_for_generate_alg(params),
)
if job_type == "mmseg.generate_alg_v1":
script = MY_DIR / "2_Initial_Alg_All_data_from_2_Alg_Program-V1.py"
return CommandSpec(
conda_python(conda_env, script),
MMSEG_DIR,
"generate MMSeg algorithm config and training command with V1 flow",
stdin_text=_stdin_for_generate_alg(params),
)
if job_type == "mmseg.generate_alg_legacy":
return CommandSpec(conda_python(conda_env, MY_DIR / "2_Initial_Alg_All-ori-old.py"), MMSEG_DIR, "run legacy original MMSeg algorithm config generator")
if job_type == "mmseg.train":
config_path = required(params, "config")
args = conda_python(conda_env, MMSEG_DIR / "tools" / "train.py", config_path)
@@ -71,6 +89,11 @@ def build_mmseg_task(job_type: str, params: dict, conda_env: str) -> CommandSpec
stdin = f"{params.get('dataset_choice', 1)}\n{params.get('algorithm_choice', 0)}\n"
return CommandSpec(args, MMSEG_DIR, "extract best MMSeg metrics from logs", stdin_text=stdin)
if job_type == "mmseg.metrics_v1":
args = conda_python(conda_env, MY_DIR / "4_2_predict_matrics_from_log_V1.py")
stdin = f"{params.get('dataset_choice', 1)}\n{params.get('algorithm_choice', 0)}\n"
return CommandSpec(args, MMSEG_DIR, "extract best MMSeg metrics from logs with V1 script", stdin_text=stdin)
if job_type == "mmseg.flops_fps":
args = conda_python(conda_env, MY_DIR / "4_1_predict_params_FLOPs_FPS_V2.py")
append_flag(args, "--input_dir", params.get("input_dir", "../Hardisk"))
@@ -81,6 +104,11 @@ def build_mmseg_task(job_type: str, params: dict, conda_env: str) -> CommandSpec
stdin += f"{params['shape_h']}\n{params['shape_w']}\n"
return CommandSpec(args, MMSEG_DIR, "calculate MMSeg FLOPs/Params/FPS", stdin_text=stdin)
if job_type == "mmseg.flops_fps_v1":
args = conda_python(conda_env, MY_DIR / "4_1_predict_params_and_FLOPs_V1.py")
stdin = f"{params.get('dataset_choice', 1)}\n{params.get('algorithm_choice', 0)}\n"
return CommandSpec(args, MMSEG_DIR, "calculate MMSeg FLOPs/Params/FPS with V1 script", stdin_text=stdin)
if job_type == "mmseg.draw":
return CommandSpec(conda_python(conda_env, MY_DIR / "4_3_predict_draw_pictures_and_tabels.py"), MMSEG_DIR, "generate MMSeg prediction pictures and tables")
@@ -90,5 +118,13 @@ def build_mmseg_task(job_type: str, params: dict, conda_env: str) -> CommandSpec
if job_type == "mmseg.delete_epoch":
return CommandSpec(conda_python(conda_env, MY_DIR / "3_Find_And_Delete_Special_Epoch.py"), MMSEG_DIR, "find and delete selected epoch checkpoints")
return None
if job_type == "mmseg.copy_result":
return CommandSpec(bash(MY_DIR / "3_Tool_Copy_Result_To_Hardisk.sh"), MMSEG_DIR, "copy MMSeg results to Hardisk")
if job_type == "mmseg.predict_v1":
return CommandSpec(conda_python(conda_env, MY_DIR / "x4_Predict_V1-.py"), MMSEG_DIR, "run MMSeg prediction V1 helper")
if job_type == "mmseg.predict_v2":
return CommandSpec(conda_python(conda_env, MY_DIR / "x4_Predict_V2-.py"), MMSEG_DIR, "run MMSeg prediction V2 helper")
return None