Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -178,12 +178,12 @@ with gr.Blocks(title="Tabular Flower Classifier", theme=gr.themes.Soft()) as dem
|
|
| 178 |
# Tabular Flower Classifier
|
| 179 |
|
| 180 |
This app uses an **AutoGluon TabularPredictor** to classify flowers based on their features.
|
| 181 |
-
|
| 182 |
""")
|
| 183 |
|
| 184 |
with gr.Row():
|
| 185 |
# LEFT: Inputs
|
| 186 |
-
with gr.Column():
|
| 187 |
gr.Markdown("### Input Features")
|
| 188 |
feature_inputs = []
|
| 189 |
|
|
@@ -196,29 +196,29 @@ with gr.Blocks(title="Tabular Flower Classifier", theme=gr.themes.Soft()) as dem
|
|
| 196 |
input_widget = gr.Number(value=0.0, label=feature)
|
| 197 |
feature_inputs.append(input_widget)
|
| 198 |
|
| 199 |
-
predict_btn = gr.Button("Predict", variant="primary")
|
| 200 |
|
| 201 |
# RIGHT: Outputs
|
| 202 |
-
with gr.Column():
|
| 203 |
-
gr.Markdown("### Results")
|
| 204 |
-
prediction_output = gr.Markdown()
|
| 205 |
-
proba_display = gr.Label(num_top_classes=
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
# Example presets
|
| 208 |
gr.Examples(
|
| 209 |
examples=EXAMPLES,
|
| 210 |
inputs=feature_inputs,
|
| 211 |
outputs=[proba_display, prediction_output],
|
| 212 |
fn=predict,
|
| 213 |
-
cache_examples=False
|
| 214 |
-
label="Example flower measurements"
|
| 215 |
-
)
|
| 216 |
-
|
| 217 |
-
# Button click handler
|
| 218 |
-
predict_btn.click(
|
| 219 |
-
fn=predict,
|
| 220 |
-
inputs=feature_inputs,
|
| 221 |
-
outputs=[proba_display, prediction_output]
|
| 222 |
)
|
| 223 |
|
| 224 |
gr.Markdown("""
|
|
|
|
| 178 |
# Tabular Flower Classifier
|
| 179 |
|
| 180 |
This app uses an **AutoGluon TabularPredictor** to classify flowers based on their features.
|
| 181 |
+
Adjust the feature values below and click **Predict** to see the classification results.
|
| 182 |
""")
|
| 183 |
|
| 184 |
with gr.Row():
|
| 185 |
# LEFT: Inputs
|
| 186 |
+
with gr.Column(scale=1):
|
| 187 |
gr.Markdown("### Input Features")
|
| 188 |
feature_inputs = []
|
| 189 |
|
|
|
|
| 196 |
input_widget = gr.Number(value=0.0, label=feature)
|
| 197 |
feature_inputs.append(input_widget)
|
| 198 |
|
| 199 |
+
predict_btn = gr.Button("Predict", variant="primary", size="lg")
|
| 200 |
|
| 201 |
# RIGHT: Outputs
|
| 202 |
+
with gr.Column(scale=1):
|
| 203 |
+
gr.Markdown("### Prediction Results")
|
| 204 |
+
prediction_output = gr.Markdown(value="*Adjust features and click Predict*")
|
| 205 |
+
proba_display = gr.Label(num_top_classes=5, label="Top 5 Class Probabilities")
|
| 206 |
|
| 207 |
+
# Button click handler
|
| 208 |
+
predict_btn.click(
|
| 209 |
+
fn=predict,
|
| 210 |
+
inputs=feature_inputs,
|
| 211 |
+
outputs=[proba_display, prediction_output]
|
| 212 |
+
)
|
| 213 |
+
|
| 214 |
+
gr.Markdown("### Example flower measurements")
|
| 215 |
# Example presets
|
| 216 |
gr.Examples(
|
| 217 |
examples=EXAMPLES,
|
| 218 |
inputs=feature_inputs,
|
| 219 |
outputs=[proba_display, prediction_output],
|
| 220 |
fn=predict,
|
| 221 |
+
cache_examples=False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
)
|
| 223 |
|
| 224 |
gr.Markdown("""
|