Munzali commited on
Commit
e2507eb
·
verified ·
1 Parent(s): d213972

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -9
app.py CHANGED
@@ -78,13 +78,48 @@ def check_membership(uploaded_image):
78
  return f"Error: {e}"
79
 
80
  # Gradio interface
81
- iface = gr.Interface(
82
- fn=check_membership,
83
- inputs=gr.Image(image_mode="RGB"),
84
- outputs="text",
85
- title="Siamese Network Membership Check",
86
- description="A security check model used to give access to the assign individual and blocks the rest"
87
- )
88
-
89
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  #share=True, auth=("username", "password")
 
78
  return f"Error: {e}"
79
 
80
  # Gradio interface
81
+
82
+ def app():
83
+ with gr.Blocks():
84
+ with gr.Row():
85
+ with gr.Column():
86
+ image = gr.Image(type="pil", label="Image")
87
+ siamese_infer = gr.Button(value="Search the image")
88
+
89
+ with gr.Column():
90
+ output_image = gr.Image(type="text", label="Resulted Search")
91
+ siamese_infer.click(
92
+ fn=check_membership,
93
+ inputs=gr.Image(image_mode="RGB"),
94
+ outputs=text,
95
+ )
96
+ gradio_app = gr.Blocks()
97
+
98
+ with gradio_app:
99
+ gr.HTML(
100
+ """
101
+ <h1 style='text-align: center'>
102
+ SIAMESE: Real-Time End-to-End Face Security System
103
+ </h1>
104
+ """)
105
+ gr.HTML(
106
+ """
107
+ <h3 style='text-align: center'>
108
+ Follow me for more!
109
+ <a href='https://twitter.com/kadirnar_ai' target='_blank'>Twitter</a> | <a href='https://github.com/kadirnar' target='_blank'>Github</a> | <a href='https://www.linkedin.com/in/kadir-nar/' target='_blank'>Linkedin</a> | <a href='https://www.huggingface.co/kadirnar/' target='_blank'>HuggingFace</a>
110
+ </h3>
111
+ """)
112
+ with gr.Row():
113
+ with gr.Column():
114
+ app()
115
+ gradio_app.launch(debug=True)
116
+ # iface = gr.Interface(
117
+ # fn=check_membership,
118
+ # inputs=gr.Image(image_mode="RGB"),
119
+ # outputs="text",
120
+ # title="Siamese Network Membership Check",
121
+ # description="A security check model used to give access to the assign individual and blocks the rest"
122
+ # )
123
+
124
+ # iface.launch()
125
  #share=True, auth=("username", "password")