Spaces:
Runtime error
Runtime error
Commit
Β·
8f9bd8a
1
Parent(s):
904353d
Update app.py
Browse files
app.py
CHANGED
@@ -567,8 +567,6 @@ home</p>""")
|
|
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**")
|
574 |
|
@@ -590,13 +588,15 @@ home</p>""")
|
|
590 |
# seed = gr.Text(label="Input Phrase")
|
591 |
text2 = gr.Text(label="Generated Phrase")
|
592 |
print(text2,'-------------')
|
|
|
|
|
|
|
|
|
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():
|
602 |
with gr.Column():
|
@@ -605,6 +605,10 @@ home</p>""")
|
|
605 |
with gr.Column():
|
606 |
# seed = gr.Text(label="Input Phrase")
|
607 |
im1 = gr.Image()
|
|
|
|
|
|
|
|
|
608 |
bbtn = gr.Button("Image from description")
|
609 |
bbtn.click(generate, inputs=[text3], outputs=im1)
|
610 |
|
@@ -613,8 +617,6 @@ home</p>""")
|
|
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():
|
620 |
# seed = gr.Text(label="Input Phrase")
|
@@ -624,6 +626,9 @@ home</p>""")
|
|
624 |
with gr.Column():
|
625 |
# seed = gr.Text(label="Input Phrase")
|
626 |
im3 = gr.Image()
|
|
|
|
|
|
|
627 |
cbtn = gr.Button("Sketch to color")
|
628 |
cbtn.click(transform, inputs=[im2,text4,text5], outputs=im3)
|
629 |
with gr.Accordion("Draw Sketch",open=False):
|
@@ -645,8 +650,6 @@ home</p>""")
|
|
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():
|
652 |
# seed = gr.Text(label="Input Phrase")
|
@@ -654,14 +657,19 @@ home</p>""")
|
|
654 |
with gr.Column():
|
655 |
# seed = gr.Text(label="Input Phrase")
|
656 |
text8 = gr.Text(label="Identified Name")
|
|
|
|
|
|
|
|
|
|
|
657 |
fbtn = gr.Button("Find the Name")
|
658 |
fbtn.click(check_database, inputs=im6, outputs=text8)
|
659 |
|
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 |
-
|
664 |
-
|
665 |
with gr.Row():
|
666 |
with gr.Column():
|
667 |
# seed = gr.Text(label="Input Phrase")
|
@@ -669,31 +677,42 @@ home</p>""")
|
|
669 |
with gr.Column():
|
670 |
text9 = gr.Text(label="Identified Title")
|
671 |
im8 = gr.Image()
|
|
|
|
|
|
|
|
|
672 |
gbtn = gr.Button("Find the Name")
|
673 |
gbtn.click(google_search, inputs=im7, outputs=[text9,im8])
|
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("**
|
678 |
-
|
|
|
679 |
with gr.Row():
|
680 |
with gr.Column():
|
681 |
fil1 = gr.File(type="file")
|
682 |
with gr.Column():
|
683 |
vid2 = gr.Video()
|
684 |
# video_name = gr.Text(label="Video Upload")
|
|
|
|
|
|
|
685 |
hbtn = gr.Button("Video")
|
686 |
hbtn.click(video, inputs=fil1, outputs=vid2)
|
687 |
|
688 |
with gr.Accordion("Generate Knowledge Graph",open=False):
|
689 |
gr.Markdown("**Genrate Knowledge Graph**")
|
690 |
-
|
691 |
with gr.Row():
|
692 |
with gr.Column():
|
693 |
prompt_to_generate_graph = gr.Text()
|
694 |
with gr.Column():
|
695 |
generated_graph_pic = gr.Image()
|
696 |
-
gr.
|
|
|
|
|
|
|
697 |
|
698 |
|
699 |
generate_knowledge_graph = gr.Button("Generate Knowledge Graph")
|
|
|
567 |
# gr.Image(detail).style(height=400, width=1200)
|
568 |
with gr.Accordion("Generate Prompt",open=False):
|
569 |
gr.Markdown("**Generate Prompt**")
|
|
|
|
|
570 |
print('DEBUG: FIRST WITH')
|
571 |
gr.Markdown("**Generate Prompt from the face description for image generation**")
|
572 |
|
|
|
588 |
# seed = gr.Text(label="Input Phrase")
|
589 |
text2 = gr.Text(label="Generated Phrase")
|
590 |
print(text2,'-------------')
|
591 |
+
gr.Markdown("**Refer to the example below**")
|
592 |
+
gr.HTML(value="<img id='generate_phrase' src='https://i.ibb.co/hm1hGsP/503e7730-b23c-401a-a73a-3fef2eb074d9.jpg' alt='Generate Prompt' width='1200' height='300'style='border: 2px solid #000;'/>")
|
593 |
+
gr.HTML(value="<style>#generate_phrase:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
594 |
+
|
595 |
abtn = gr.Button("Generate mugshot phrase")
|
596 |
abtn.click(generate_prompt, inputs=[text1_1,text1_2,text1_3,text1_4], outputs=text2)
|
597 |
with gr.Accordion("Generate MugShot",open=False):
|
598 |
gr.Markdown("**Generate MugShot from the input prompt using StableDiffusion**")
|
599 |
gr.Markdown("**Use StableDiffusion Image Generation for text to image**")
|
|
|
|
|
600 |
# model = gr.Radio(["StableDiffusion"])
|
601 |
with gr.Row():
|
602 |
with gr.Column():
|
|
|
605 |
with gr.Column():
|
606 |
# seed = gr.Text(label="Input Phrase")
|
607 |
im1 = gr.Image()
|
608 |
+
gr.Markdown("**Refer to the example below**")
|
609 |
+
gr.HTML(value="<img id='genrate_mugshot' src='https://i.ibb.co/9WsBLD0/21aa355d-5005-4fbb-bf50-4ded05e6075e.jpg' alt='Genrate image from prompt' style='height:500px;width:1200px;border: 2px solid #000;'/>")
|
610 |
+
gr.HTML(value="<style>#genrate_mugshot:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
611 |
+
|
612 |
bbtn = gr.Button("Image from description")
|
613 |
bbtn.click(generate, inputs=[text3], outputs=im1)
|
614 |
|
|
|
617 |
with gr.Accordion("Pre-drawn Sketch",open=False):
|
618 |
gr.Markdown("**Generate Colorful Image from pre drawn sketch**")
|
619 |
gr.Markdown("**Use StableDiffusion Depth2Image for Image to Image transformation**")
|
|
|
|
|
620 |
with gr.Row():
|
621 |
with gr.Column():
|
622 |
# seed = gr.Text(label="Input Phrase")
|
|
|
626 |
with gr.Column():
|
627 |
# seed = gr.Text(label="Input Phrase")
|
628 |
im3 = gr.Image()
|
629 |
+
gr.Markdown("**Refer to the example below**")
|
630 |
+
gr.HTML(value="<img id='image_to_image' src='https://i.ibb.co/H4k0B7k/c58db90d-9479-411d-aaff-15863d2479a0.jpg' alt='Generate Image from sketch' style='height:500px;width:1200px;border: 2px solid #000;'/>")
|
631 |
+
gr.HTML(value="<style>#image_to_image:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
632 |
cbtn = gr.Button("Sketch to color")
|
633 |
cbtn.click(transform, inputs=[im2,text4,text5], outputs=im3)
|
634 |
with gr.Accordion("Draw Sketch",open=False):
|
|
|
650 |
with gr.Accordion("Check Database",open=False):
|
651 |
gr.Markdown("**Check if the image matches any image in our database using face recognition**")
|
652 |
gr.Markdown("**Use Face Recognition, Face Detection and Computer Vision to match images**")
|
|
|
|
|
653 |
with gr.Row():
|
654 |
with gr.Column():
|
655 |
# seed = gr.Text(label="Input Phrase")
|
|
|
657 |
with gr.Column():
|
658 |
# seed = gr.Text(label="Input Phrase")
|
659 |
text8 = gr.Text(label="Identified Name")
|
660 |
+
|
661 |
+
gr.Markdown("**Refer to the example below**")
|
662 |
+
gr.HTML(value="<img id='search_database' src='https://i.ibb.co/bBnDxqT/c5d2fe61-4b99-4cbc-934c-1ae9edfa4386.png' alt='Check Database' width='1200' height='300' style='border: 2px solid #000;'/>")
|
663 |
+
gr.HTML(value="<style>#search_database:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
664 |
+
|
665 |
fbtn = gr.Button("Find the Name")
|
666 |
fbtn.click(check_database, inputs=im6, outputs=text8)
|
667 |
|
668 |
with gr.Accordion("Search Google",open=False):
|
669 |
gr.Markdown("**Check if the image is present on the Internet**")
|
670 |
gr.Markdown("**Using Google search api to search the image on Web**")
|
671 |
+
|
672 |
+
|
673 |
with gr.Row():
|
674 |
with gr.Column():
|
675 |
# seed = gr.Text(label="Input Phrase")
|
|
|
677 |
with gr.Column():
|
678 |
text9 = gr.Text(label="Identified Title")
|
679 |
im8 = gr.Image()
|
680 |
+
|
681 |
+
gr.Markdown("**Refer to the example below**")
|
682 |
+
gr.HTML(value="<img id='search_google' src='https://i.ibb.co/9v7vwVF/58f827cc-e24a-4df8-ab0f-40204d0940ec.jpg' alt='Check Google' width='1200' height='300' style='border: 2px solid #000;'/>")
|
683 |
+
gr.HTML(value="<style>#search_google:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
684 |
gbtn = gr.Button("Find the Name")
|
685 |
gbtn.click(google_search, inputs=im7, outputs=[text9,im8])
|
686 |
|
687 |
with gr.Accordion("Search in CCTV footage",open=False):
|
688 |
gr.Markdown("**Upload a video to identify missing person in the footage**")
|
689 |
+
gr.Markdown("**This feature need GPU to run**")
|
690 |
+
|
691 |
+
|
692 |
with gr.Row():
|
693 |
with gr.Column():
|
694 |
fil1 = gr.File(type="file")
|
695 |
with gr.Column():
|
696 |
vid2 = gr.Video()
|
697 |
# video_name = gr.Text(label="Video Upload")
|
698 |
+
gr.Markdown("**Refer to the example below**")
|
699 |
+
gr.HTML(value="<img id='cctv' src='https://i.ibb.co/H7t0R5C/bb71faf0-f86f-4064-b796-7a4dea6efdc7.jpg' alt='Check cctv' width='1200' height='300' style='border: 2px solid #000;'/>")
|
700 |
+
gr.HTML(value="<style>#cctv:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
701 |
hbtn = gr.Button("Video")
|
702 |
hbtn.click(video, inputs=fil1, outputs=vid2)
|
703 |
|
704 |
with gr.Accordion("Generate Knowledge Graph",open=False):
|
705 |
gr.Markdown("**Genrate Knowledge Graph**")
|
706 |
+
|
707 |
with gr.Row():
|
708 |
with gr.Column():
|
709 |
prompt_to_generate_graph = gr.Text()
|
710 |
with gr.Column():
|
711 |
generated_graph_pic = gr.Image()
|
712 |
+
gr.Markdown("**Refer to the example below on how generated knowledge graph**")
|
713 |
+
gr.HTML(value="<img id='knowledge_generate_graph' src='https://i.ibb.co/j3j5Y3Q/4f4f9ed9-b52d-4ed9-a5e8-5864bffd4718.jpg' alt='Generate knowlwdge graph' width='1200' height='300' style='border: 2px solid #000;'/>")
|
714 |
+
gr.HTML(value="<style>#knowledge_generate_graph:hover{box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);}</style>")
|
715 |
+
|
716 |
|
717 |
|
718 |
generate_knowledge_graph = gr.Button("Generate Knowledge Graph")
|