Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,12 +59,13 @@ def predict_age(image):
|
|
| 59 |
age = output.item() # Convert to a single scalar
|
| 60 |
return f"Predicted Age: {age:.2f}"
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
| 70 |
|
|
|
|
| 59 |
age = output.item() # Convert to a single scalar
|
| 60 |
return f"Predicted Age: {age:.2f}"
|
| 61 |
|
| 62 |
+
import gradio as gr
|
| 63 |
+
|
| 64 |
+
gr.Interface(
|
| 65 |
+
fn=predict_fn,
|
| 66 |
+
inputs=gr.Image(type="pil", image_mode="RGB"),
|
| 67 |
+
outputs="number", # or "text" if your output is text-based
|
| 68 |
+
title="Age Prediction from Face",
|
| 69 |
+
description="Upload a face image and get the predicted age."
|
| 70 |
+
).launch()
|
| 71 |
|