MoinulwithAI commited on
Commit
024b978
·
verified ·
1 Parent(s): 30463cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- # Replace gr.inputs.Image with just gr.Image
 
67
  iface = gr.Interface(
68
  fn=predict_age,
69
- inputs=gr.Image(shape=(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,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
+