import json def export_json_report(speed, bounce_frame, lbw_decision, output_path="report.json"): report = { "lbw_decision": lbw_decision, "speed_kmph": round(speed, 2), "bounce_frame": bounce_frame } with open(output_path, "w") as f: json.dump(report, f, indent=2)