Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,11 @@ import joblib
|
|
5 |
import tensorflow as tf
|
6 |
import pandas as pd
|
7 |
from joblib import load
|
8 |
-
|
9 |
from tensorflow.keras.models import load_model
|
10 |
from sklearn.preprocessing import MinMaxScaler
|
11 |
import os
|
12 |
-
import sklearn
|
13 |
|
|
|
14 |
print(f"Gradio version: {gr.__version__}")
|
15 |
print(f"NumPy version: {np.__version__}")
|
16 |
print(f"Scikit-learn version: {sklearn.__version__}")
|
@@ -112,19 +111,24 @@ outputs = [
|
|
112 |
]
|
113 |
|
114 |
with gr.Blocks() as demo:
|
115 |
-
gr.Markdown("
|
116 |
-
gr.Markdown("
|
|
|
|
|
117 |
with gr.Row():
|
118 |
with gr.Column():
|
119 |
gr.Markdown("### Input Parameters")
|
120 |
for inp in inputs:
|
121 |
inp.render()
|
|
|
|
|
|
|
122 |
gr.Button(value="Submit", variant="primary").click(fn=gradio_interface, inputs=inputs, outputs=outputs)
|
123 |
gr.Button(value="Clear").click(fn=lambda: None)
|
|
|
124 |
with gr.Column():
|
125 |
gr.Markdown("### Output Predictions")
|
126 |
for out in outputs:
|
127 |
out.render()
|
128 |
-
gr.Image(image_path, width=500, height=300) # Adjust the width and height as needed
|
129 |
|
130 |
demo.launch()
|
|
|
5 |
import tensorflow as tf
|
6 |
import pandas as pd
|
7 |
from joblib import load
|
|
|
8 |
from tensorflow.keras.models import load_model
|
9 |
from sklearn.preprocessing import MinMaxScaler
|
10 |
import os
|
|
|
11 |
|
12 |
+
# Display library versions
|
13 |
print(f"Gradio version: {gr.__version__}")
|
14 |
print(f"NumPy version: {np.__version__}")
|
15 |
print(f"Scikit-learn version: {sklearn.__version__}")
|
|
|
111 |
]
|
112 |
|
113 |
with gr.Blocks() as demo:
|
114 |
+
gr.Markdown("<h1 style='text-align: center;'>Environmental Factor-Based Contamination Level Prediction</h1>")
|
115 |
+
gr.Markdown("This application predicts the contamination levels on different parts of a car's LiDAR system based on environmental factors such as velocity, temperature, precipitation, and humidity.")
|
116 |
+
|
117 |
+
# Layout with two columns
|
118 |
with gr.Row():
|
119 |
with gr.Column():
|
120 |
gr.Markdown("### Input Parameters")
|
121 |
for inp in inputs:
|
122 |
inp.render()
|
123 |
+
|
124 |
+
# Display the car image immediately after inputs
|
125 |
+
gr.Image(image_path, width=500, height=300) # Adjust the width and height as needed
|
126 |
gr.Button(value="Submit", variant="primary").click(fn=gradio_interface, inputs=inputs, outputs=outputs)
|
127 |
gr.Button(value="Clear").click(fn=lambda: None)
|
128 |
+
|
129 |
with gr.Column():
|
130 |
gr.Markdown("### Output Predictions")
|
131 |
for out in outputs:
|
132 |
out.render()
|
|
|
133 |
|
134 |
demo.launch()
|