safinal commited on
Commit
c902692
Β·
verified Β·
1 Parent(s): 455daca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -157,10 +157,10 @@ def interface_fn(selected_image, query_text):
157
  demo = gr.Interface(
158
  fn=interface_fn,
159
  inputs=[
160
- gr.Image(type="filepath", label="Select Query Image"),
161
- gr.Textbox(label="Enter Query Text")
162
  ],
163
- outputs=gr.Image(label="Retrieved Image"),
164
  title="Compositional Image Retrieval",
165
  description="Select an image and enter a text query to find the most similar image.",
166
  examples=[
@@ -168,12 +168,14 @@ demo = gr.Interface(
168
  ["sample_evaluation/images/283700.png", "add bowl and bench and remove shoe and elephant"],
169
  ["sample_evaluation/images/455007.png", "Discard chair in the beginning, then proceed to bring car into play."],
170
  ["sample_evaluation/images/612311.png", "Get rid of train initially, and then follow up by including snowboard."]
171
- ]
 
 
172
  )
173
 
174
  if __name__ == "__main__":
175
  try:
176
- demo.launch()
177
  except Exception as e:
178
  print(f"Error launching app: {str(e)}")
179
  raise
 
157
  demo = gr.Interface(
158
  fn=interface_fn,
159
  inputs=[
160
+ gr.Image(type="filepath", label="Select Query Image", image_mode="RGB"),
161
+ gr.Textbox(label="Enter Query Text", lines=2)
162
  ],
163
+ outputs=gr.Image(label="Retrieved Image", type="pil"),
164
  title="Compositional Image Retrieval",
165
  description="Select an image and enter a text query to find the most similar image.",
166
  examples=[
 
168
  ["sample_evaluation/images/283700.png", "add bowl and bench and remove shoe and elephant"],
169
  ["sample_evaluation/images/455007.png", "Discard chair in the beginning, then proceed to bring car into play."],
170
  ["sample_evaluation/images/612311.png", "Get rid of train initially, and then follow up by including snowboard."]
171
+ ],
172
+ allow_flagging=False,
173
+ cache_examples=False
174
  )
175
 
176
  if __name__ == "__main__":
177
  try:
178
+ demo.queue().launch(server_name="0.0.0.0", server_port=7860)
179
  except Exception as e:
180
  print(f"Error launching app: {str(e)}")
181
  raise