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()