File size: 1,323 Bytes
e1c08ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from __future__ import annotations

import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
    sys.path.insert(0, str(ROOT))

from lol_viewport.metrics import evaluate_box_dir


REPLAYS = [
    "241019_TESvsT1_3Set_cropped",
    "241020_GENvsFLY_3Set_cropped",
    "241026_WBGvsBLG_3Set_cropped",
    "241027_T1vsGEN_3Set_cropped",
    "241102_T1vsBLG_3Set_cropped",
]

METHODS = {
    "random_champion_selection": "Random Champion Selection",
    "riot_observer_system": "Riot Observer System Supervision",
    "10ch_onehot_per_champion": "10-ch + One-hot (per champion)",
    "1ch_10_champions": "1-ch (10 champions)",
    "2ch_onehot": "2-ch + One-hot",
    "2ch_role_ours": "2-ch + Role (Ours)",
}


def main() -> None:
    root = ROOT / "data" / "evaluation_boxes"
    print("| Method / Setting | Mean IoU | IoU >= 0.3 (%) | IoU >= 0.5 (%) | IoU >= 0.7 (%) | Frames |")
    print("| --- | ---: | ---: | ---: | ---: | ---: |")
    for directory, label in METHODS.items():
        summary = evaluate_box_dir(root / directory, REPLAYS)
        print(
            f"| {label} | {summary.mean_iou:.4f} | {summary.iou_ge_03:.2f} | "
            f"{summary.iou_ge_05:.2f} | {summary.iou_ge_07:.2f} | {summary.frames} |"
        )


if __name__ == "__main__":
    main()