Update app.py
Browse files
app.py
CHANGED
|
@@ -423,44 +423,43 @@ def create_gradio_interface():
|
|
| 423 |
)
|
| 424 |
|
| 425 |
with gr.Blocks(css="""
|
| 426 |
-
.contain {margin-left: auto; margin-right: auto
|
| 427 |
-
.
|
| 428 |
""") as interface:
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
elevation_input = gr.File(label="Elevation Data (NPY)", scale=1)
|
| 439 |
-
|
| 440 |
-
# ๋ ์จ ํ๋ผ๋ฏธํฐ ์
๋ ฅ
|
| 441 |
-
with gr.Column(scale=1):
|
| 442 |
-
wind_speed = gr.Number(label="Wind Speed (m/s)", value=5.0)
|
| 443 |
-
wind_direction = gr.Number(label="Wind Direction (ยฐ)", value=180.0)
|
| 444 |
-
temperature = gr.Number(label="Temperature (ยฐC)", value=25.0)
|
| 445 |
-
humidity = gr.Number(label="Humidity (%)", value=60.0)
|
| 446 |
-
predict_btn = gr.Button("Generate Predictions", variant="primary", size="lg")
|
| 447 |
-
|
| 448 |
-
# ์ถ๋ ฅ ์น์
- ์ ์ฒด ๋๋น ์ฌ์ฉ
|
| 449 |
-
with gr.Box(elem_classes="plot-container"):
|
| 450 |
-
output_plot = gr.Plot(label="Prediction Results", container=True)
|
| 451 |
|
| 452 |
-
#
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
|
| 465 |
predict_btn.click(
|
| 466 |
fn=predict_with_processing,
|
|
|
|
| 423 |
)
|
| 424 |
|
| 425 |
with gr.Blocks(css="""
|
| 426 |
+
.contain {margin-left: auto; margin-right: auto}
|
| 427 |
+
.output-plot {min-height: 600px !important; width: 100% !important;}
|
| 428 |
""") as interface:
|
| 429 |
+
gr.Markdown("# Renewable Energy Potential Predictor")
|
| 430 |
+
|
| 431 |
+
# ์
๋ ฅ ์น์
- ํ๋์ Row์ ๋ชจ๋ ์
๋ ฅ ๋ฐฐ์น
|
| 432 |
+
with gr.Row(equal_height=True):
|
| 433 |
+
# ์ด๋ฏธ์ง/ํ์ผ ์
๋ ฅ
|
| 434 |
+
rgb_input = gr.Image(label="RGB Satellite Image", type="numpy", height=150, scale=1)
|
| 435 |
+
ndvi_input = gr.Image(label="NDVI Image", type="numpy", height=150, scale=1)
|
| 436 |
+
terrain_input = gr.Image(label="Terrain Map", type="numpy", height=150, scale=1)
|
| 437 |
+
elevation_input = gr.File(label="Elevation Data (NPY)", scale=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
|
| 439 |
+
# ๋ ์จ ํ๋ผ๋ฏธํฐ ์
๋ ฅ
|
| 440 |
+
with gr.Column(scale=1):
|
| 441 |
+
wind_speed = gr.Number(label="Wind Speed (m/s)", value=5.0)
|
| 442 |
+
wind_direction = gr.Number(label="Wind Direction (ยฐ)", value=180.0)
|
| 443 |
+
temperature = gr.Number(label="Temperature (ยฐC)", value=25.0)
|
| 444 |
+
humidity = gr.Number(label="Humidity (%)", value=60.0)
|
| 445 |
+
predict_btn = gr.Button("Generate Predictions", variant="primary", size="lg")
|
| 446 |
+
|
| 447 |
+
# ์ถ๋ ฅ ์น์
- ์ ์ฒด ๋๋น ์ฌ์ฉ
|
| 448 |
+
with gr.Column(elem_classes="output-plot"):
|
| 449 |
+
output_plot = gr.Plot(label="Prediction Results", container=True)
|
| 450 |
+
|
| 451 |
+
# ์์ ์น์
|
| 452 |
+
examples = load_examples_from_directory("filtered_climate_data")
|
| 453 |
+
gr.Examples(
|
| 454 |
+
examples=examples,
|
| 455 |
+
inputs=[rgb_input, ndvi_input, terrain_input, elevation_input,
|
| 456 |
+
wind_speed, wind_direction, temperature, humidity],
|
| 457 |
+
outputs=output_plot,
|
| 458 |
+
fn=predict_with_processing,
|
| 459 |
+
cache_examples=True,
|
| 460 |
+
label="Click any example to run",
|
| 461 |
+
examples_per_page=5
|
| 462 |
+
)
|
| 463 |
|
| 464 |
predict_btn.click(
|
| 465 |
fn=predict_with_processing,
|