Download scripts/evaluate_table.py from ureca07/lol_viewport: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/ureca07/lol_viewport/resolve/main/scripts/evaluate_table.py
- Command line
-
hf download hf://datasets/ureca07/lol_viewport/scripts/evaluate_table.py
-
curl -L -o evaluate_table.py https://huggingface.co/datasets/ureca07/lol_viewport/resolve/main/scripts/evaluate_table.py
1.32 kB
| 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() | |