Parse single epoch training curves

This commit is contained in:
2026-06-30 23:42:11 +08:00
parent 3e9e8ba6f5
commit 6b3a3d7c6d
3 changed files with 39 additions and 12 deletions

View File

@@ -28,6 +28,26 @@ def test_parse_yolo_results_curve(tmp_path: Path):
assert all("lr/" not in name for name in names)
def test_parse_single_epoch_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),lr/pg0",
"1,1.0,1.5,3.0,0.12,0.001",
]
),
encoding="utf-8",
)
curve = parse_training_curve(csv_path)
assert curve is not None
assert curve["row_count"] == 1
seg_loss = next(item for item in curve["series"] if item["name"] == "train/seg_loss")
assert seg_loss["points"] == [{"x": 1.0, "y": 3.0}]
def test_results_api_honors_limit(monkeypatch):
calls = {}