Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import datasets
|
|
6 |
import requests
|
7 |
import json
|
8 |
import dateutil.parser as dp
|
|
|
9 |
|
10 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
11 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
|
@@ -47,6 +48,15 @@ fesn1h = json_response_smhi["timeSeries"][0]["parameters"][8]["values"][0
|
|
47 |
vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
|
48 |
|
49 |
|
50 |
-
row =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
gr.Interface(fn = infer, inputs = inputs, outputs = outputs, title=title, description=description, examples=row).launch()
|
|
|
6 |
import requests
|
7 |
import json
|
8 |
import dateutil.parser as dp
|
9 |
+
import pandas as pd
|
10 |
|
11 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
12 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
|
|
|
48 |
vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
|
49 |
|
50 |
|
51 |
+
row ={"referenceTime": referenceTime,
|
52 |
+
"t": t,
|
53 |
+
"ws": ws,
|
54 |
+
"prec1h": prec1h,
|
55 |
+
"fesn1h": fesn1h,
|
56 |
+
"vis": vis,
|
57 |
+
"confidence": confidence,
|
58 |
+
"congestionLevel": congestionLevel}
|
59 |
+
|
60 |
+
row = pd.DataFrame.from_dict(row)
|
61 |
|
62 |
gr.Interface(fn = infer, inputs = inputs, outputs = outputs, title=title, description=description, examples=row).launch()
|