Spaces:
Runtime error
Runtime error
Create report.py
Browse files
report.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
|
| 3 |
+
def export_json_report(speed, bounce_frame, lbw_decision, output_path="report.json"):
|
| 4 |
+
report = {
|
| 5 |
+
"lbw_decision": lbw_decision,
|
| 6 |
+
"speed_kmph": round(speed, 2),
|
| 7 |
+
"bounce_frame": bounce_frame
|
| 8 |
+
}
|
| 9 |
+
with open(output_path, "w") as f:
|
| 10 |
+
json.dump(report, f, indent=2)
|