MoinulwithAI commited on
Commit
609997a
·
verified ·
1 Parent(s): 10a8094

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -61,10 +61,12 @@ def predict_age(image):
61
  age = output.item() # Convert to a single scalar
62
  return f"Predicted Age: {age:.2f}"
63
 
64
- # -------- GRADIO INTERFACE --------
 
 
65
  iface = gr.Interface(
66
  fn=predict_age,
67
- inputs=gr.inputs.Image(shape=(128, 128), image_mode='RGB', source='upload'),
68
  outputs="text",
69
  title="Age Prediction Model",
70
  description="Upload an image to predict the age.",
@@ -72,3 +74,4 @@ iface = gr.Interface(
72
  )
73
 
74
  iface.launch()
 
 
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.",
 
74
  )
75
 
76
  iface.launch()
77
+