File size: 3,130 Bytes
137c6cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python3
"""Verify what configuration is being loaded for each video."""

import json
from pathlib import Path

OUTPUT_DIR = Path("output")
DATA_CONFIG_DIR = Path("data/config")


def get_video_basename(video_name: str) -> str:
    """Get a clean basename from video name."""
    basename = Path(video_name).stem
    for char in [" ", ".", "-"]:
        basename = basename.replace(char, "_")
    while "__" in basename:
        basename = basename.replace("__", "_")
    return basename.strip("_")


def print_video_config(video_name: str):
    """Print configuration for a specific video."""
    basename = get_video_basename(video_name)
    print(f"\n{'='*60}")
    print(f"VIDEO: {video_name}")
    print(f"Config basename: {basename}")
    print("=" * 60)

    # Check session config
    session_config_path = OUTPUT_DIR / f"{basename}_config.json"
    if session_config_path.exists():
        with open(session_config_path, "r") as f:
            config = json.load(f)
        print(f"\n  Session Config ({session_config_path.name}):")
        print(f"    Scorebug: ({config.get('scorebug_x')}, {config.get('scorebug_y')})")
        print(f"    Flag offset: ({config.get('flag_x_offset')}, {config.get('flag_y_offset')})")
        print(f"    Flag size: {config.get('flag_width')}x{config.get('flag_height')}")
    else:
        print(f"\n  Session Config: NOT FOUND (expected: {session_config_path})")

    # Check timeout config
    timeout_config_path = OUTPUT_DIR / f"{basename}_timeout_config.json"
    if timeout_config_path.exists():
        print(f"  Timeout Config: {timeout_config_path.name}")
    else:
        print(f"  Timeout Config: NOT FOUND")

    # Check playclock config
    playclock_config_path = OUTPUT_DIR / f"{basename}_playclock_config.json"
    if playclock_config_path.exists():
        print(f"  Playclock Config: {playclock_config_path.name}")
    else:
        print(f"  Playclock Config: NOT FOUND")


def main():
    print("=" * 80)
    print("CONFIGURATION FILES STATUS")
    print("=" * 80)

    # Known videos
    videos = [
        "OSU vs Tenn 12.21.24.mkv",
        "OSU vs Texas 01.10.25.mkv",
        "OSU vs Oregon 01.01.25.mkv",
        "OSU vs ND 01.20.25.mp4",
    ]

    for video in videos:
        print_video_config(video)

    # Check for GENERIC configs that might cause confusion
    print("\n" + "=" * 80)
    print("WARNING: GENERIC CONFIGS (may cause video cross-contamination)")
    print("=" * 80)

    generic_configs = [
        DATA_CONFIG_DIR / "flag_region.json",
        DATA_CONFIG_DIR / "play_clock_region.json",
        DATA_CONFIG_DIR / "timeout_tracker_region.json",
    ]

    for config_path in generic_configs:
        if config_path.exists():
            with open(config_path, "r") as f:
                config = json.load(f)
            source = config.get("source_video", "UNKNOWN")
            print(f"  {config_path.name}: source={source}")
            print(f"    -> Scripts should use video-specific configs instead!")
        else:
            print(f"  {config_path.name}: NOT FOUND (OK)")


if __name__ == "__main__":
    main()