Expand Seg task coverage and coverage dashboard
This commit is contained in:
@@ -4,16 +4,21 @@ from pathlib import Path
|
||||
|
||||
from ..catalog import get_catalog
|
||||
from ..config import settings
|
||||
from ..coverage import get_coverage_report
|
||||
|
||||
|
||||
REQUIRED_TASKS = {
|
||||
"dataset.upload": "covered_by_api",
|
||||
"dataset.video_frames": "job",
|
||||
"dataset.yolo_txt_sort": "job",
|
||||
"segmodel.train": "job",
|
||||
"segmodel.predict": "job",
|
||||
"yolo.heatmap": "job",
|
||||
"yolo.video_visible": "job",
|
||||
"mmseg.flops_fps": "job",
|
||||
"analysis.all": "job",
|
||||
"visual.fps": "job",
|
||||
"system.check_graph_card": "job",
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +28,7 @@ def evaluate_project() -> dict:
|
||||
backend = settings.project_root / "backend" / "app" / "main.py"
|
||||
readme = settings.project_root / "README.md"
|
||||
catalog = get_catalog()
|
||||
coverage = get_coverage_report()
|
||||
checks = []
|
||||
suggestions = []
|
||||
|
||||
@@ -35,8 +41,12 @@ def evaluate_project() -> dict:
|
||||
"upload_ui": "uploadDatasetFiles" in frontend_text and "labels" in frontend_text and "masks" in frontend_text,
|
||||
"loss_result_ui": "loss" in frontend_text.lower() and "heatmap" in frontend_text.lower(),
|
||||
"dataset_api": "/api/datasets" in backend_text and "api_upload_dataset_files" in backend_text,
|
||||
"coverage_api": "/api/coverage" in backend_text and coverage["task_build_passed"],
|
||||
"visual_tools": "visual.yolo11_heatmap_v2" in catalog["task_types"] and "visual.fps" in catalog["task_types"],
|
||||
"yolo_dataset_tools": "dataset.yolo_txt_sort" in catalog["task_types"] and "dataset.yolo_resize" in catalog["task_types"],
|
||||
"no_weight_to_gitea": "Do not push" in readme_text and "check_no_weight_git" in readme_text,
|
||||
"all_core_tasks": all(task in catalog["task_types"] for task in REQUIRED_TASKS if REQUIRED_TASKS[task] == "job"),
|
||||
"mapped_user_scripts": not coverage["unmapped_user_scripts"],
|
||||
}
|
||||
|
||||
for name, passed in expectations.items():
|
||||
@@ -48,6 +58,8 @@ def evaluate_project() -> dict:
|
||||
suggestions.append("MMSeg algorithm catalog should expose all 31 algorithm generators.")
|
||||
if len(catalog["segmodel_architectures"]) < 12:
|
||||
suggestions.append("SegModel catalog should expose all 12 supported architectures.")
|
||||
if coverage["unmapped_user_scripts"]:
|
||||
suggestions.append(f"Map remaining user-facing scripts: {len(coverage['unmapped_user_scripts'])}")
|
||||
if not suggestions:
|
||||
suggestions.append("Current platform covers the requested control-plane features; next focus is real dataset/training acceptance tests.")
|
||||
|
||||
@@ -58,4 +70,3 @@ def evaluate_project() -> dict:
|
||||
"checks": checks,
|
||||
"suggestions": suggestions,
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ from pathlib import Path
|
||||
|
||||
from ..catalog import get_catalog
|
||||
from ..config import settings
|
||||
from ..coverage import get_coverage_report
|
||||
from ..modules.system.service import get_conda_envs, get_gpus
|
||||
from ..modules.weights.service import load_manifest
|
||||
|
||||
@@ -28,10 +29,10 @@ def _run(command: list[str], cwd: Path | None = None, timeout: int = 60) -> dict
|
||||
def _fetch(url: str, timeout: int = 5) -> dict:
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=timeout) as response:
|
||||
body = response.read(20000).decode("utf-8", errors="replace")
|
||||
body = response.read(200000).decode("utf-8", errors="replace")
|
||||
return {"url": url, "status": response.status, "body": body, "passed": 200 <= response.status < 300}
|
||||
except urllib.error.HTTPError as exc:
|
||||
body = exc.read(20000).decode("utf-8", errors="replace")
|
||||
body = exc.read(200000).decode("utf-8", errors="replace")
|
||||
return {"url": url, "status": exc.code, "body": body, "passed": False}
|
||||
except Exception as exc:
|
||||
return {"url": url, "error": str(exc), "passed": False}
|
||||
@@ -42,9 +43,14 @@ def validate_project(run_build: bool = False) -> dict:
|
||||
checks = []
|
||||
catalog = get_catalog()
|
||||
manifest = load_manifest()
|
||||
coverage = get_coverage_report()
|
||||
|
||||
checks.append({"name": "catalog_has_yolo_heatmap", "passed": "yolo.heatmap" in catalog["task_types"]})
|
||||
checks.append({"name": "catalog_has_mmseg_31_algs", "passed": len(catalog["mmseg_algorithms"]) >= 31})
|
||||
checks.append({"name": "catalog_has_visual_tools", "passed": "visual.yolo11_heatmap_v2" in catalog["task_types"] and "visual.fps" in catalog["task_types"]})
|
||||
checks.append({"name": "catalog_has_yolo_dataset_tools", "passed": "dataset.yolo_txt_sort" in catalog["task_types"] and "dataset.yolo_convert_png" in catalog["task_types"]})
|
||||
checks.append({"name": "task_buildability", "passed": coverage["task_build_passed"], "detail": coverage["task_build_checks"]})
|
||||
checks.append({"name": "script_coverage_user_facing", "passed": not coverage["unmapped_user_scripts"], "detail": coverage})
|
||||
checks.append({"name": "weights_manifest_present", "passed": manifest.get("count", 0) >= 1})
|
||||
checks.append({"name": "gpus_query", "passed": bool(get_gpus().get("available"))})
|
||||
env_names = [item["name"] for item in get_conda_envs().get("envs", [])]
|
||||
@@ -72,9 +78,11 @@ def validate_project(run_build: bool = False) -> dict:
|
||||
frontend_url = os.getenv("SEG_VALIDATE_FRONTEND_URL", "http://127.0.0.1:5173")
|
||||
health = _fetch(f"{backend_url}/api/health")
|
||||
datasets = _fetch(f"{backend_url}/api/datasets")
|
||||
live_coverage = _fetch(f"{backend_url}/api/coverage")
|
||||
frontend = _fetch(frontend_url)
|
||||
checks.append({"name": "live_backend_health", "passed": health["passed"] and '"ok":true' in health.get("body", "").replace(" ", ""), "detail": health})
|
||||
checks.append({"name": "live_dataset_api", "passed": datasets["passed"] and datasets.get("body", "").lstrip().startswith("["), "detail": datasets})
|
||||
checks.append({"name": "live_coverage_api", "passed": live_coverage["passed"] and '"task_build_passed":true' in live_coverage.get("body", "").replace(" ", ""), "detail": live_coverage})
|
||||
checks.append({"name": "live_frontend_index", "passed": frontend["passed"] and "Seg Data Server" in frontend.get("body", ""), "detail": frontend})
|
||||
|
||||
if run_build:
|
||||
|
||||
Reference in New Issue
Block a user