File size: 1,237 Bytes
b2f3ea1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import os
import glob
from app import load_and_render, run_analysis, DATA_DIR

def verify():
    print("Verifying data availability...")
    candidates = glob.glob(os.path.join(DATA_DIR, "*.pkl"))
    if not candidates:
        print("No candidates found in data directory!")
        return
    
    # Prioritize full samples over test_small.pkl
    candidate_file = "p_005.pkl"

    print(f"Testing with candidate: {candidate_file}")
    
    # Test Loading and Rendering
    print("\n--- Testing load_and_render ---")
    video_path = load_and_render(candidate_file)
    
    if not video_path or not os.path.exists(video_path):
        print(f"FAILED: Video rendering failed for {candidate_file}")
        return
    print(f"SUCCESS: Video rendered as {video_path}")
    
    # Test Analysis
    print("\n--- Testing run_analysis ---")
    output_video, output_json = run_analysis(candidate_file, video_path)
    
    if not output_video:
        print(f"FAILED: Analysis failed. Error: {output_json}")
    else:
        print(f"SUCCESS: Analysis complete.")
        print(f"Output Video: {output_video}")
        # print(f"JSON Result: {output_json}")

if __name__ == "__main__":
    verify()