File size: 989 Bytes
3894000
 
 
 
 
 
 
 
 
 
86258b2
3894000
 
 
 
 
 
 
 
86258b2
 
 
3894000
 
 
86258b2
3894000
 
 
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
import gradio as gr
import geopandas as gpd
from shapely.geometry import shape

def predict(geojson1, geojson2, value):
    # Read the GeoJSON files
    gdf1 = gpd.read_file(geojson1.name)
    gdf2 = gpd.read_file(geojson2.name)

    # Use the model to make a prediction
    #output_image = model.predict(gdf1, gdf2, value)

    # Return the image
    return output_image

iface = gr.Interface(
    fn=predict, 
    inputs=[
        gr.inputs.File(label="GeoJSON Input 1"), 
        gr.inputs.File(label="GeoJSON Input 2"), #This should be optional
        gr.inputs.Slider(minimum=0.0, maximum=10.0, default=4.3, label="Building Height Multiplier"),
        gr.inputs.Number(default=200, label="Default Building Height"), #Can I make this optional?
    ], 
    outputs=gr.outputs.Image(type="pil"),
    title="Shadow Proximity",
    description="Upload proposed building footprints in a GeoJSON file and select a numeric value to get the building proximity prediction.",
)

iface.launch()