Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,12 +61,12 @@ def predict_age(image):
|
|
| 61 |
age = output.item() # Convert to a single scalar
|
| 62 |
return f"Predicted Age: {age:.2f}"
|
| 63 |
|
| 64 |
-
import gradio as gr
|
| 65 |
|
| 66 |
-
|
|
|
|
| 67 |
iface = gr.Interface(
|
| 68 |
fn=predict_age,
|
| 69 |
-
inputs=gr.Image(
|
| 70 |
outputs="text",
|
| 71 |
title="Age Prediction Model",
|
| 72 |
description="Upload an image to predict the age.",
|
|
@@ -75,3 +75,4 @@ iface = gr.Interface(
|
|
| 75 |
|
| 76 |
iface.launch()
|
| 77 |
|
|
|
|
|
|
| 61 |
age = output.item() # Convert to a single scalar
|
| 62 |
return f"Predicted Age: {age:.2f}"
|
| 63 |
|
|
|
|
| 64 |
|
| 65 |
+
|
| 66 |
+
# Update the gr.Image initialization
|
| 67 |
iface = gr.Interface(
|
| 68 |
fn=predict_age,
|
| 69 |
+
inputs=gr.Image(image_size=(128, 128), image_mode='RGB', source='upload'),
|
| 70 |
outputs="text",
|
| 71 |
title="Age Prediction Model",
|
| 72 |
description="Upload an image to predict the age.",
|
|
|
|
| 75 |
|
| 76 |
iface.launch()
|
| 77 |
|
| 78 |
+
|