justin2341 commited on
Commit
e3fc4da
·
verified ·
1 Parent(s): 78c0fef

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +26 -0
demo.py CHANGED
@@ -138,6 +138,32 @@ with gr.Blocks() as demo:
138
  ##### Documentation - Help Center - https://docs.kby-ai.com
139
  """
140
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceRecognition"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceRecognition&countColor=%23263759" /></a>')
142
 
143
  demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
138
  ##### Documentation - Help Center - https://docs.kby-ai.com
139
  """
140
  )
141
+ with gr.TabItem("Face Recognition"):
142
+ gr.Markdown(
143
+ """
144
+ ##### Docker Hub - https://hub.docker.com/r/kbyai/face-recognition
145
+ ```bash
146
+ sudo docker pull kbyai/face-recognition:latest
147
+ sudo docker run -e LICENSE="xxxxx" -p 8081:8080 -p 9001:9000 kbyai/face-recognition:latest
148
+ ```
149
+ """
150
+ )
151
+ with gr.Column(scale=7):
152
+ with gr.Row():
153
+ with gr.Column():
154
+ image_input1 = gr.Image(type='filepath')
155
+ gr.Examples(['face_examples/1.jpg', 'face_examples/3.jpg', 'face_examples/5.jpg', 'face_examples/7.jpg', 'face_examples/9.jpg'],
156
+ inputs=image_input1)
157
+ with gr.Column():
158
+ image_input2 = gr.Image(type='filepath')
159
+ gr.Examples(['face_examples/2.jpg', 'face_examples/4.jpg', 'face_examples/6.jpg', 'face_examples/8.jpg', 'face_examples/10.jpg'],
160
+ inputs=image_input2)
161
+ face_recog_button = gr.Button("Compare Face", variant="primary", size="lg")
162
+ with gr.Column(scale=3):
163
+ recog_html_output = gr.HTML()
164
+
165
+ face_recog_button.click(compare_face, inputs=[image_input1, image_input2], outputs=recog_html_output)
166
+
167
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceRecognition"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceRecognition&countColor=%23263759" /></a>')
168
 
169
  demo.launch(server_name="0.0.0.0", server_port=7860, share=True)