Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,14 +59,12 @@ def predict_age(image):
|
|
| 59 |
age = output.item() # Convert to a single scalar
|
| 60 |
return f"Predicted Age: {age:.2f}"
|
| 61 |
|
| 62 |
-
# -------- GRADIO INTERFACE --------
|
| 63 |
iface = gr.Interface(
|
| 64 |
fn=predict_age,
|
| 65 |
-
inputs=gr.Image(
|
| 66 |
outputs="text",
|
| 67 |
title="Age Prediction Model",
|
| 68 |
description="Upload an image to predict the age.",
|
| 69 |
live=True
|
| 70 |
)
|
| 71 |
|
| 72 |
-
iface.launch()
|
|
|
|
| 59 |
age = output.item() # Convert to a single scalar
|
| 60 |
return f"Predicted Age: {age:.2f}"
|
| 61 |
|
|
|
|
| 62 |
iface = gr.Interface(
|
| 63 |
fn=predict_age,
|
| 64 |
+
inputs=gr.Image(image_mode='RGB', source='upload'), # Removed image_size
|
| 65 |
outputs="text",
|
| 66 |
title="Age Prediction Model",
|
| 67 |
description="Upload an image to predict the age.",
|
| 68 |
live=True
|
| 69 |
)
|
| 70 |
|
|
|