itayitay123 commited on
Commit
3832834
·
verified ·
1 Parent(s): e1fcf2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -69,8 +69,7 @@ def recommend_from_upload(uploaded_image):
69
  similar_imgs = find_similar(uploaded_image, top_k=3, exclude_index=closest_idx)
70
 
71
  # Use a gray image as the "best generated outfit"
72
- placeholder_img = Image.open("example5.jpg").resize((512, 512))
73
-
74
 
75
  return [uploaded_image] + similar_imgs + [placeholder_img]
76
 
@@ -94,12 +93,11 @@ with gr.Blocks() as demo:
94
  generate_btn = gr.Button("Generate Recommendations")
95
 
96
  with gr.Row():
97
- output1 = gr.Image(label="Your Input", height=512, width=384)
98
- output2 = gr.Image(label="Similar Item 1", height=512, width=384)
99
- output3 = gr.Image(label="Similar Item 2", height=512, width=384)
100
- output4 = gr.Image(label="Similar Item 3", height=512, width=384)
101
- output5 = gr.Image(label="Simulated AI-Generated Outfit", height=512, width=384)
102
-
103
 
104
  examples = gr.Examples(
105
  examples=example_paths,
 
69
  similar_imgs = find_similar(uploaded_image, top_k=3, exclude_index=closest_idx)
70
 
71
  # Use a gray image as the "best generated outfit"
72
+ placeholder_img = Image.new("RGB", (512, 512), color="gray")
 
73
 
74
  return [uploaded_image] + similar_imgs + [placeholder_img]
75
 
 
93
  generate_btn = gr.Button("Generate Recommendations")
94
 
95
  with gr.Row():
96
+ output1 = gr.Image(label="Your Input")
97
+ output2 = gr.Image(label="Similar Item 1")
98
+ output3 = gr.Image(label="Similar Item 2")
99
+ output4 = gr.Image(label="Similar Item 3")
100
+ output5 = gr.Image(label="Simulated AI-Generated Outfit")
 
101
 
102
  examples = gr.Examples(
103
  examples=example_paths,