File size: 722 Bytes
ec765f7
87b98d4
5cd41bc
ec765f7
ca823ee
e93edee
87b98d4
e93edee
87b98d4
 
 
 
 
5cd41bc
beae3a1
a576faa
 
 
 
 
5cd41bc
 
ec765f7
e93edee
 
 
 
 
 
 
 
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
import gradio as gr
import json
from utils.main_processor import get_statistics


# Interface
with gr.Blocks() as ui:

    with gr.Row():
        with gr.Column():
            file_input = gr.File(file_types=[".geojson"])
            submit_btn = gr.Button("Submit")
        with gr.Column():
            output = gr.Text()
    
    # Second row for additional outputs
    #with gr.Row():
     #   statistics_output = gr.Dataframe(label="Statistics Summary")
    
    # Submit button action
    submit_btn.click(get_statistics, 
    file_input, output)

# Launch app
if __name__ == "__main__":
    ui.launch(
        server_name="0.0.0.0",
        server_port=7860, 
        #mcp_server=True,
        show_error=True
    )