Spaces:
Build error
Build error
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() |