MoinulwithAI commited on
Commit
0202ce7
·
verified ·
1 Parent(s): 5b50c83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
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
- 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
 
 
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