vaniv commited on
Commit
76335e8
·
verified ·
1 Parent(s): 945d993

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -63,17 +63,16 @@ def predict(image):
63
  garment_recommendation, color_recommendation = get_outfit_recommendation(pred_class, dominant_color)
64
  return f"Predicted category: {pred_class}\nRecommended complementary item: {garment_recommendation} in {color_recommendation}"
65
 
66
- # Define the Gradio interface
67
  def gradio_predict(image):
68
  image = Image.open(image).convert('RGB')
69
  return predict(image)
70
 
71
  interface = gr.Interface(
72
  fn=gradio_predict,
73
- inputs=gr.inputs.Image(shape=(224, 224)),
74
  outputs="text",
75
  title="Outfit Recommender",
76
  description="Upload an image of a garment to get a recommendation for a complementary outfit based on fashion theory."
77
  )
78
 
79
- interface.launch()
 
63
  garment_recommendation, color_recommendation = get_outfit_recommendation(pred_class, dominant_color)
64
  return f"Predicted category: {pred_class}\nRecommended complementary item: {garment_recommendation} in {color_recommendation}"
65
 
 
66
  def gradio_predict(image):
67
  image = Image.open(image).convert('RGB')
68
  return predict(image)
69
 
70
  interface = gr.Interface(
71
  fn=gradio_predict,
72
+ inputs=gr.Image(shape=(224, 224)), # Changed from gr.inputs.Image
73
  outputs="text",
74
  title="Outfit Recommender",
75
  description="Upload an image of a garment to get a recommendation for a complementary outfit based on fashion theory."
76
  )
77
 
78
+ interface.launch()