Spaces:
Running
Running
Update demo.py
Browse files
demo.py
CHANGED
|
@@ -106,48 +106,20 @@ def compare_face(frame1, frame2):
|
|
| 106 |
return [faces, html]
|
| 107 |
|
| 108 |
with gr.Blocks() as demo:
|
| 109 |
-
gr.
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
with gr.TabItem("Face Recognition"):
|
| 127 |
-
gr.Markdown(
|
| 128 |
-
"""
|
| 129 |
-
##### Docker Hub - https://hub.docker.com/r/kbyai/face-recognition
|
| 130 |
-
```bash
|
| 131 |
-
sudo docker pull kbyai/face-recognition:latest
|
| 132 |
-
sudo docker run -e LICENSE="xxxxx" -p 8081:8080 -p 9001:9000 kbyai/face-recognition:latest
|
| 133 |
-
```
|
| 134 |
-
"""
|
| 135 |
-
)
|
| 136 |
-
with gr.Row():
|
| 137 |
-
with gr.Column():
|
| 138 |
-
compare_face_input1 = gr.Image(type='filepath')
|
| 139 |
-
gr.Examples(['face_examples/1.jpg', 'face_examples/3.jpg', 'face_examples/5.jpg', 'face_examples/7.jpg', 'face_examples/9.jpg'],
|
| 140 |
-
inputs=compare_face_input1)
|
| 141 |
-
compare_face_button = gr.Button("Compare Face")
|
| 142 |
-
with gr.Column():
|
| 143 |
-
compare_face_input2 = gr.Image(type='filepath')
|
| 144 |
-
gr.Examples(['face_examples/2.jpg', 'face_examples/4.jpg', 'face_examples/6.jpg', 'face_examples/8.jpg', 'face_examples/10.jpg'],
|
| 145 |
-
inputs=compare_face_input2)
|
| 146 |
-
with gr.Column():
|
| 147 |
-
compare_face_output = gr.Image(type="pil").style(height=150)
|
| 148 |
-
compare_result_output = gr.HTML(label='Result')
|
| 149 |
-
|
| 150 |
-
compare_face_button.click(compare_face, inputs=[compare_face_input1, compare_face_input2], outputs=[compare_face_output, compare_result_output])
|
| 151 |
-
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>')
|
| 152 |
-
|
| 153 |
-
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|
|
|
|
| 106 |
return [faces, html]
|
| 107 |
|
| 108 |
with gr.Blocks() as demo:
|
| 109 |
+
with gr.Row():
|
| 110 |
+
with gr.Column():
|
| 111 |
+
compare_face_input1 = gr.Image(type='filepath')
|
| 112 |
+
gr.Examples(['face_examples/1.jpg', 'face_examples/3.jpg', 'face_examples/5.jpg', 'face_examples/7.jpg', 'face_examples/9.jpg'],
|
| 113 |
+
inputs=compare_face_input1)
|
| 114 |
+
compare_face_button = gr.Button("Compare Face")
|
| 115 |
+
with gr.Column():
|
| 116 |
+
compare_face_input2 = gr.Image(type='filepath')
|
| 117 |
+
gr.Examples(['face_examples/2.jpg', 'face_examples/4.jpg', 'face_examples/6.jpg', 'face_examples/8.jpg', 'face_examples/10.jpg'],
|
| 118 |
+
inputs=compare_face_input2)
|
| 119 |
+
with gr.Column():
|
| 120 |
+
compare_face_output = gr.Image(type="pil").style(height=150)
|
| 121 |
+
compare_result_output = gr.HTML(label='Result')
|
| 122 |
+
|
| 123 |
+
compare_face_button.click(compare_face, inputs=[compare_face_input1, compare_face_input2], outputs=[compare_face_output, compare_result_output])
|
| 124 |
+
|
| 125 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|