justin2341 commited on
Commit
5dad965
·
verified ·
1 Parent(s): acd33cc

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +17 -16
demo.py CHANGED
@@ -122,21 +122,22 @@ def compare_face(frame1, frame2):
122
  # return result.text
123
 
124
  with gr.Blocks(css=".gradio-container {background-color: #F4E5E0}") as demo:
125
- with gr.Row():
126
- with gr.Column(scale=7):
127
- with gr.Row():
128
- with gr.Column():
129
- image_input1 = gr.Image(type='filepath')
130
- gr.Examples(['face_examples/1.jpg', 'face_examples/3.jpg', 'face_examples/7.jpg', 'face_examples/9.jpg'],
131
- inputs=image_input1)
132
- with gr.Column():
133
- image_input2 = gr.Image(type='filepath')
134
- gr.Examples(['face_examples/2.jpg', 'face_examples/4.jpg', 'face_examples/8.jpg', 'face_examples/10.jpg'],
135
- inputs=image_input2)
136
- face_recog_button = gr.Button("Compare Face")
137
- with gr.Column(scale=3):
138
- recog_html_output = gr.HTML()
139
-
140
- face_recog_button.click(compare_face, inputs=[image_input1, image_input2], outputs=recog_html_output)
 
141
 
142
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
122
  # return result.text
123
 
124
  with gr.Blocks(css=".gradio-container {background-color: #F4E5E0}") as demo:
125
+ with gr.TabItem("Face Recognition Online Demo"):
126
+ with gr.Row():
127
+ with gr.Column(scale=7):
128
+ with gr.Row():
129
+ with gr.Column():
130
+ image_input1 = gr.Image(type='filepath')
131
+ gr.Examples(['face_examples/1.jpg', 'face_examples/3.jpg', 'face_examples/7.jpg', 'face_examples/9.jpg'],
132
+ inputs=image_input1)
133
+ with gr.Column():
134
+ image_input2 = gr.Image(type='filepath')
135
+ gr.Examples(['face_examples/2.jpg', 'face_examples/4.jpg', 'face_examples/8.jpg', 'face_examples/10.jpg'],
136
+ inputs=image_input2)
137
+ face_recog_button = gr.Button("Compare Face")
138
+ with gr.Column(scale=3):
139
+ recog_html_output = gr.HTML()
140
+
141
+ face_recog_button.click(compare_face, inputs=[image_input1, image_input2], outputs=recog_html_output)
142
 
143
  demo.launch(server_name="0.0.0.0", server_port=7860)