-
Notifications
You must be signed in to change notification settings - Fork 4
/
view.pyt
80 lines (65 loc) · 1.92 KB
/
view.pyt
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import gradio as gr
from main import routine
from osm2csv import process_address
import osm2csv as ocv
from inout import gen_csv
# import logging
# logging.basicConfig(level=logging.CRITICAL)
# def proc(input1):
# loc = process_address(input1)
# gen_csv(loc, "raw_demands.csv", place_type="any")
# routine(loc)
# return gr.Image("out/anim_network0.gif")
# iface = gr.Interface(
# fn=proc,
# inputs=[gr.Textbox(label="Enter the Location")],
# outputs="image",
# title="Landru",
# description="Landru Tate - Advaned Geospatial Traffic Optimization Simulator",
# )
# iface.launch()
import logging
logging.basicConfig(level=logging.CRITICAL)
def proc(
input1,
rad_dist,
global_mean_jam_density,
jam_density_variance,
freeflow_speed_variance,
freeflow_mean_shiftcoef,
):
ocv.global_warming(
rad_dist,
global_mean_jam_density,
jam_density_variance,
freeflow_speed_variance,
freeflow_mean_shiftcoef,
)
loc = process_address(input1)
gen_csv(loc, "raw_demands.csv", place_type="any")
routine(loc)
return gr.Image("out/anim_network0.gif")
iface = gr.Interface(
fn=proc,
inputs=[
gr.Textbox(label="Enter the Location"),
gr.Slider(minimum=0.1, maximum=5.0, value=1.5, label="Radius Distance"),
gr.Slider(
minimum=0.05, maximum=0.25, value=0.16, label="Global Mean Jam Density"
),
gr.Slider(minimum=0.01, maximum=0.05, value=0.02, label="Jam Density Variance"),
gr.Slider(
minimum=0.01, maximum=0.1, value=0.05, label="Free Flow Speed Variance"
),
gr.Slider(
minimum=0.0001,
maximum=0.01,
value=0.0025,
label="Free Flow Mean Shift Coefficient",
),
],
outputs="image",
title="Landru",
description="Advanced Geospatial Traffic Optimization Simulator",
)
iface.launch()