Pash1986 commited on
Commit
22c391b
β€’
1 Parent(s): 113b2e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -40
app.py CHANGED
@@ -370,48 +370,48 @@ def start_image_search(image, text):
370
 
371
  with gr.Blocks() as demo:
372
 
373
- with gr.Tab("Celeb Matcher Demo"):
374
- with gr.Tab("Demo"):
375
- gr.Markdown("""
376
- # MongoDB's Vector Celeb Image Matcher
377
-
378
- Upload an image and find the most similar celeb image from the database, along with an AI-generated description.
379
-
380
- πŸ’ͺ Make a great pose to impact the search! 🀯
381
- """)
382
- with gr.Row():
383
- with gr.Column():
384
- image_input = gr.Image(type="pil", label="Upload an image")
385
- text_input = gr.Textbox(label="Enter an adjustment to the image")
386
- search_button = gr.Button("Search")
 
387
 
388
-
389
- with gr.Column():
390
- output_gallery = gr.Gallery(label="Located images", show_label=False, elem_id="gallery",
391
- columns=[3], rows=[1], object_fit="contain", height="auto")
392
- output_description = gr.Textbox(label="AI Based vision description")
393
- gr.Markdown("""
394
-
395
- """)
396
- with gr.Row():
397
- email_input = gr.Textbox(label="Enter your email")
398
- company_input = gr.Textbox(label="Enter your company name")
399
- record_button = gr.Button("Record & Download PDF")
400
-
401
- search_button.click(
402
- fn=start_image_search,
403
- inputs=[image_input, text_input],
404
- outputs=[output_gallery, output_description]
405
- )
 
 
 
 
 
 
 
406
 
407
- record_button.click(
408
- fn=record_participant,
409
- inputs=[email_input, company_input, output_description, output_gallery],
410
- outputs=gr.File(label="Download Search Results as PDF")
411
- )
412
- with gr.Tab("Code"):
413
- gr.Code(label="Code", language="python", value=fetch_url_data('https://huggingface.co/spaces/MongoDB/aws-bedrock-celeb-matcher/raw/main/app.py'))
414
-
415
  with gr.Tab("Chat RAG Demo"):
416
  with gr.Tab("Demo"):
417
  gr.ChatInterface(get_movies, examples=["What movies are scary?", "Find me a comedy", "Movies for kids"], title="Movies Atlas Vector Search",description="This small chat uses a similarity search to find relevant movies, it uses MongoDB Atlas Vector Search read more here: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-tutorial",submit_btn="Search").queue()
 
370
 
371
  with gr.Blocks() as demo:
372
 
373
+ with gr.Tab("Celeb Matcher Demo"):
374
+ with gr.Tab("Demo"):
375
+ gr.Markdown("""
376
+ # MongoDB's Vector Celeb Image Matcher
377
+
378
+ Upload an image and find the most similar celeb image from the database, along with an AI-generated description.
379
+
380
+ πŸ’ͺ Make a great pose to impact the search! 🀯
381
+ """)
382
+ with gr.Row():
383
+ with gr.Column():
384
+ image_input = gr.Image(type="pil", label="Upload an image")
385
+ text_input = gr.Textbox(label="Enter an adjustment to the image")
386
+ search_button = gr.Button("Search")
387
+
388
 
389
+ with gr.Column():
390
+ output_gallery = gr.Gallery(label="Located images", show_label=False, elem_id="gallery",
391
+ columns=[3], rows=[1], object_fit="contain", height="auto")
392
+ output_description = gr.Textbox(label="AI Based vision description")
393
+ gr.Markdown("""
394
+
395
+ """)
396
+ with gr.Row():
397
+ email_input = gr.Textbox(label="Enter your email")
398
+ company_input = gr.Textbox(label="Enter your company name")
399
+ record_button = gr.Button("Record & Download PDF")
400
+
401
+ search_button.click(
402
+ fn=start_image_search,
403
+ inputs=[image_input, text_input],
404
+ outputs=[output_gallery, output_description]
405
+ )
406
+
407
+ record_button.click(
408
+ fn=record_participant,
409
+ inputs=[email_input, company_input, output_description, output_gallery],
410
+ outputs=gr.File(label="Download Search Results as PDF")
411
+ )
412
+ with gr.Tab("Code"):
413
+ gr.Code(label="Code", language="python", value=fetch_url_data('https://huggingface.co/spaces/MongoDB/aws-bedrock-celeb-matcher/raw/main/app.py'))
414
 
 
 
 
 
 
 
 
 
415
  with gr.Tab("Chat RAG Demo"):
416
  with gr.Tab("Demo"):
417
  gr.ChatInterface(get_movies, examples=["What movies are scary?", "Find me a comedy", "Movies for kids"], title="Movies Atlas Vector Search",description="This small chat uses a similarity search to find relevant movies, it uses MongoDB Atlas Vector Search read more here: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-tutorial",submit_btn="Search").queue()