Spaces:
Runtime error
Runtime error
Commit
Β·
cb797e3
1
Parent(s):
0937fe3
Added example for knowledge graph
Browse files
app.py
CHANGED
|
@@ -554,7 +554,7 @@ with gr.Blocks(css=".gradio-container {background-color: #F0FFFF}") as demo:
|
|
| 554 |
# gr.Markdown("! [title](https://pixabay.com/photos/tree-sunset-clouds-sky-silhouette-736885/)")
|
| 555 |
gr.Markdown("""<p style='color:black;font-family:monospace'>Our Sherlock's Phoeniks Search Squad solution is a facial recognition
|
| 556 |
system that utilizes generative AI models like ChatGPT and stable
|
| 557 |
-
diffusion
|
| 558 |
missing persons in real time . The system will take input in the form of text
|
| 559 |
describing the appearance of the missing person, as well as raw images
|
| 560 |
such as sketches, CCTV footage, or blurry photos. The algorithm will then
|
|
@@ -566,6 +566,8 @@ home</p>""")
|
|
| 566 |
gr.HTML(value="<img src='https://i.ibb.co/Ms1jcDv/104cc37752fa.png' alt='Flow Diagram' style='height:500px;width:1200px'>")
|
| 567 |
# gr.Image(detail).style(height=400, width=1200)
|
| 568 |
with gr.Accordion("Generate Prompt",open=False):
|
|
|
|
|
|
|
| 569 |
gr.HTML(value="<img src='https://i.ibb.co/hm1hGsP/503e7730-b23c-401a-a73a-3fef2eb074d9.jpg' alt='Generate Prompt' width='1200' height='300'/>")
|
| 570 |
print('DEBUG: FIRST WITH')
|
| 571 |
gr.Markdown("**Generate Prompt from the face description for image generation**")
|
|
@@ -591,8 +593,9 @@ home</p>""")
|
|
| 591 |
abtn = gr.Button("Generate mugshot phrase")
|
| 592 |
abtn.click(generate_prompt, inputs=[text1_1,text1_2,text1_3,text1_4], outputs=text2)
|
| 593 |
with gr.Accordion("Generate MugShot",open=False):
|
| 594 |
-
gr.Markdown("**Generate MugShot from the input prompt using
|
| 595 |
gr.Markdown("**Use StableDiffusion Image Generation for text to image**")
|
|
|
|
| 596 |
gr.HTML(value="<img src='https://i.ibb.co/9WsBLD0/21aa355d-5005-4fbb-bf50-4ded05e6075e.jpg' alt='Genrate image from prompt' style='height:500px;width:1200px'>")
|
| 597 |
# model = gr.Radio(["StableDiffusion"])
|
| 598 |
with gr.Row():
|
|
@@ -610,6 +613,7 @@ home</p>""")
|
|
| 610 |
with gr.Accordion("Pre-drawn Sketch",open=False):
|
| 611 |
gr.Markdown("**Generate Colorful Image from pre drawn sketch**")
|
| 612 |
gr.Markdown("**Use StableDiffusion Depth2Image for Image to Image transformation**")
|
|
|
|
| 613 |
gr.HTML(value="<img src='https://i.ibb.co/H4k0B7k/c58db90d-9479-411d-aaff-15863d2479a0.jpg' alt='Generate Image from sketch' style='height:500px;width:1200px'>")
|
| 614 |
with gr.Row():
|
| 615 |
with gr.Column():
|
|
@@ -639,8 +643,9 @@ home</p>""")
|
|
| 639 |
ebtn.click(transform1, inputs=[im4,text6,text7], outputs=im5)
|
| 640 |
|
| 641 |
with gr.Accordion("Check Database",open=False):
|
| 642 |
-
gr.Markdown("**Check if the image matches any image in our database using
|
| 643 |
gr.Markdown("**Use Face Recognition, Face Detection and Computer Vision to match images**")
|
|
|
|
| 644 |
gr.HTML(value="<img src='https://i.ibb.co/bBnDxqT/c5d2fe61-4b99-4cbc-934c-1ae9edfa4386.png' alt='Check Database' width='1200' height='300'/>")
|
| 645 |
with gr.Row():
|
| 646 |
with gr.Column():
|
|
@@ -655,6 +660,7 @@ home</p>""")
|
|
| 655 |
with gr.Accordion("Search Google",open=False):
|
| 656 |
gr.Markdown("**Check if the image is present on the Internet**")
|
| 657 |
gr.Markdown("**Using Google search api to search the image on Web**")
|
|
|
|
| 658 |
gr.HTML(value="<img src='https://i.ibb.co/9v7vwVF/58f827cc-e24a-4df8-ab0f-40204d0940ec.jpg' alt='Check Google' width='1200' height='300'/>")
|
| 659 |
with gr.Row():
|
| 660 |
with gr.Column():
|
|
@@ -668,6 +674,7 @@ home</p>""")
|
|
| 668 |
|
| 669 |
with gr.Accordion("Search in CCTV footage",open=False):
|
| 670 |
gr.Markdown("**Upload a video to identify missing person in the footage**")
|
|
|
|
| 671 |
gr.HTML(value="<img src='https://i.ibb.co/H7t0R5C/bb71faf0-f86f-4064-b796-7a4dea6efdc7.jpg' alt='Check cctv' width='1200' height='300'/>")
|
| 672 |
with gr.Row():
|
| 673 |
with gr.Column():
|
|
@@ -680,6 +687,8 @@ home</p>""")
|
|
| 680 |
|
| 681 |
with gr.Accordion("Generate Knowledge Graph",open=False):
|
| 682 |
gr.Markdown("**Genrate Knowledge Graph**")
|
|
|
|
|
|
|
| 683 |
with gr.Row():
|
| 684 |
with gr.Column():
|
| 685 |
prompt_to_generate_graph = gr.Text()
|
|
|
|
| 554 |
# gr.Markdown("! [title](https://pixabay.com/photos/tree-sunset-clouds-sky-silhouette-736885/)")
|
| 555 |
gr.Markdown("""<p style='color:black;font-family:monospace'>Our Sherlock's Phoeniks Search Squad solution is a facial recognition
|
| 556 |
system that utilizes generative AI models like ChatGPT and stable
|
| 557 |
+
diffusion, as well as computer vision techniques, to identify and locate
|
| 558 |
missing persons in real time . The system will take input in the form of text
|
| 559 |
describing the appearance of the missing person, as well as raw images
|
| 560 |
such as sketches, CCTV footage, or blurry photos. The algorithm will then
|
|
|
|
| 566 |
gr.HTML(value="<img src='https://i.ibb.co/Ms1jcDv/104cc37752fa.png' alt='Flow Diagram' style='height:500px;width:1200px'>")
|
| 567 |
# gr.Image(detail).style(height=400, width=1200)
|
| 568 |
with gr.Accordion("Generate Prompt",open=False):
|
| 569 |
+
gr.Markdown("**Generate Prompt**")
|
| 570 |
+
gr.Markdown("**Refer to the example below**")
|
| 571 |
gr.HTML(value="<img src='https://i.ibb.co/hm1hGsP/503e7730-b23c-401a-a73a-3fef2eb074d9.jpg' alt='Generate Prompt' width='1200' height='300'/>")
|
| 572 |
print('DEBUG: FIRST WITH')
|
| 573 |
gr.Markdown("**Generate Prompt from the face description for image generation**")
|
|
|
|
| 593 |
abtn = gr.Button("Generate mugshot phrase")
|
| 594 |
abtn.click(generate_prompt, inputs=[text1_1,text1_2,text1_3,text1_4], outputs=text2)
|
| 595 |
with gr.Accordion("Generate MugShot",open=False):
|
| 596 |
+
gr.Markdown("**Generate MugShot from the input prompt using StableDiffusion**")
|
| 597 |
gr.Markdown("**Use StableDiffusion Image Generation for text to image**")
|
| 598 |
+
gr.Markdown("**Refer to the example below**")
|
| 599 |
gr.HTML(value="<img src='https://i.ibb.co/9WsBLD0/21aa355d-5005-4fbb-bf50-4ded05e6075e.jpg' alt='Genrate image from prompt' style='height:500px;width:1200px'>")
|
| 600 |
# model = gr.Radio(["StableDiffusion"])
|
| 601 |
with gr.Row():
|
|
|
|
| 613 |
with gr.Accordion("Pre-drawn Sketch",open=False):
|
| 614 |
gr.Markdown("**Generate Colorful Image from pre drawn sketch**")
|
| 615 |
gr.Markdown("**Use StableDiffusion Depth2Image for Image to Image transformation**")
|
| 616 |
+
gr.Markdown("**Refer to the example below**")
|
| 617 |
gr.HTML(value="<img src='https://i.ibb.co/H4k0B7k/c58db90d-9479-411d-aaff-15863d2479a0.jpg' alt='Generate Image from sketch' style='height:500px;width:1200px'>")
|
| 618 |
with gr.Row():
|
| 619 |
with gr.Column():
|
|
|
|
| 643 |
ebtn.click(transform1, inputs=[im4,text6,text7], outputs=im5)
|
| 644 |
|
| 645 |
with gr.Accordion("Check Database",open=False):
|
| 646 |
+
gr.Markdown("**Check if the image matches any image in our database using face recognition**")
|
| 647 |
gr.Markdown("**Use Face Recognition, Face Detection and Computer Vision to match images**")
|
| 648 |
+
gr.Markdown("**Refer to the example below**")
|
| 649 |
gr.HTML(value="<img src='https://i.ibb.co/bBnDxqT/c5d2fe61-4b99-4cbc-934c-1ae9edfa4386.png' alt='Check Database' width='1200' height='300'/>")
|
| 650 |
with gr.Row():
|
| 651 |
with gr.Column():
|
|
|
|
| 660 |
with gr.Accordion("Search Google",open=False):
|
| 661 |
gr.Markdown("**Check if the image is present on the Internet**")
|
| 662 |
gr.Markdown("**Using Google search api to search the image on Web**")
|
| 663 |
+
gr.Markdown("**Refer to the example below**")
|
| 664 |
gr.HTML(value="<img src='https://i.ibb.co/9v7vwVF/58f827cc-e24a-4df8-ab0f-40204d0940ec.jpg' alt='Check Google' width='1200' height='300'/>")
|
| 665 |
with gr.Row():
|
| 666 |
with gr.Column():
|
|
|
|
| 674 |
|
| 675 |
with gr.Accordion("Search in CCTV footage",open=False):
|
| 676 |
gr.Markdown("**Upload a video to identify missing person in the footage**")
|
| 677 |
+
gr.Markdown("**Refer to the example below**")
|
| 678 |
gr.HTML(value="<img src='https://i.ibb.co/H7t0R5C/bb71faf0-f86f-4064-b796-7a4dea6efdc7.jpg' alt='Check cctv' width='1200' height='300'/>")
|
| 679 |
with gr.Row():
|
| 680 |
with gr.Column():
|
|
|
|
| 687 |
|
| 688 |
with gr.Accordion("Generate Knowledge Graph",open=False):
|
| 689 |
gr.Markdown("**Genrate Knowledge Graph**")
|
| 690 |
+
gr.Markdown("**Refer to the example below**")
|
| 691 |
+
gr.HTML(value="<img src='https://i.ibb.co/j3j5Y3Q/4f4f9ed9-b52d-4ed9-a5e8-5864bffd4718.jpg' alt='Generate knowlwdge graph' width='1200' height='300'/>")
|
| 692 |
with gr.Row():
|
| 693 |
with gr.Column():
|
| 694 |
prompt_to_generate_graph = gr.Text()
|