Add result curve discovery dashboard

This commit is contained in:
2026-06-30 13:35:07 +08:00
parent 2d7d54ba13
commit 7d6e1692b1
10 changed files with 554 additions and 22 deletions

View File

@@ -0,0 +1,27 @@
from pathlib import Path
from app.modules.results.service import parse_training_curve
def test_parse_yolo_results_curve(tmp_path: Path):
csv_path = tmp_path / "results.csv"
csv_path.write_text(
"\n".join(
[
"epoch,time,train/box_loss,train/seg_loss,metrics/mAP50(M),val/seg_loss,lr/pg0",
"1,1.0,1.5,3.0,0.12,2.8,0.001",
"2,2.0,1.2,2.5,0.18,2.1,0.001",
"3,3.0,0.9,2.0,0.25,1.9,0.001",
]
),
encoding="utf-8",
)
curve = parse_training_curve(csv_path)
assert curve is not None
assert curve["x_key"] == "epoch"
names = [item["name"] for item in curve["series"]]
assert "train/seg_loss" in names
assert "metrics/mAP50(M)" in names
assert all("lr/" not in name for name in names)