HoeioUser commited on
Commit
5dbc592
ยท
verified ยท
1 Parent(s): 0c3d154

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -36
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; max-height: 800px}
427
- .plot-container {height: 600px !important; width: 100% !important;}
428
  """) as interface:
429
- with gr.Column():
430
- gr.Markdown("# Renewable Energy Potential Predictor")
431
-
432
- # ์ž…๋ ฅ ์„น์…˜ - ํ•˜๋‚˜์˜ Row์— ๋ชจ๋“  ์ž…๋ ฅ ๋ฐฐ์น˜
433
- with gr.Row(equal_height=True):
434
- # ์ด๋ฏธ์ง€/ํŒŒ์ผ ์ž…๋ ฅ
435
- rgb_input = gr.Image(label="RGB Satellite Image", type="numpy", height=150, scale=1)
436
- ndvi_input = gr.Image(label="NDVI Image", type="numpy", height=150, scale=1)
437
- terrain_input = gr.Image(label="Terrain Map", type="numpy", height=150, scale=1)
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
- examples = load_examples_from_directory("filtered_climate_data")
454
- gr.Examples(
455
- examples=examples,
456
- inputs=[rgb_input, ndvi_input, terrain_input, elevation_input,
457
- wind_speed, wind_direction, temperature, humidity],
458
- outputs=output_plot,
459
- fn=predict_with_processing,
460
- cache_examples=True,
461
- label="Click any example to run",
462
- examples_per_page=5
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,