Update demo.py
Browse files
demo.py
CHANGED
@@ -122,44 +122,16 @@ def check_liveness(frame):
|
|
122 |
return [faces, html]
|
123 |
|
124 |
with gr.Blocks() as demo:
|
125 |
-
gr.
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
</span>
|
135 |
-
</h4>
|
136 |
|
137 |
-
|
138 |
-
##### ID Capture Web Demo - https://id-document-recognition-react-alpha.vercel.app
|
139 |
-
##### Documentation - Help Center - https://docs.kby-ai.com
|
140 |
-
"""
|
141 |
-
)
|
142 |
-
with gr.TabItem("Face Liveness Detection"):
|
143 |
-
gr.Markdown(
|
144 |
-
"""
|
145 |
-
##### Docker Hub - https://hub.docker.com/r/kbyai/face-liveness-detection
|
146 |
-
```bash
|
147 |
-
sudo docker pull kbyai/face-liveness-detection:latest
|
148 |
-
sudo docker run -e LICENSE="xxxxx" -p 8080:8080 -p 9000:9000 kbyai/face-liveness-detection:latest
|
149 |
-
```
|
150 |
-
"""
|
151 |
-
)
|
152 |
-
with gr.Row():
|
153 |
-
with gr.Column():
|
154 |
-
live_image_input = gr.Image(type='filepath')
|
155 |
-
gr.Examples(['live_examples/1.jpg', 'live_examples/2.jpg', 'live_examples/3.jpg', 'live_examples/4.jpg'],
|
156 |
-
inputs=live_image_input)
|
157 |
-
check_liveness_button = gr.Button("Check Liveness")
|
158 |
-
with gr.Column():
|
159 |
-
liveness_face_output = gr.Image(type="pil").style(height=150)
|
160 |
-
livness_result_output = gr.HTML()
|
161 |
-
|
162 |
-
check_liveness_button.click(check_liveness, inputs=live_image_input, outputs=[liveness_face_output, livness_result_output])
|
163 |
-
gr.HTML('<a href="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceLivenessDetection&countColor=%23263759"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FFaceLivenessDetection&countColor=%23263759&label=VISITORS&countColor=%23263759" /></a>')
|
164 |
|
165 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
122 |
return [faces, html]
|
123 |
|
124 |
with gr.Blocks() as demo:
|
125 |
+
with gr.Row():
|
126 |
+
with gr.Column():
|
127 |
+
live_image_input = gr.Image(type='filepath')
|
128 |
+
gr.Examples(['live_examples/1.jpg', 'live_examples/2.jpg', 'live_examples/3.jpg', 'live_examples/4.jpg'],
|
129 |
+
inputs=live_image_input)
|
130 |
+
check_liveness_button = gr.Button("Check Liveness")
|
131 |
+
with gr.Column():
|
132 |
+
liveness_face_output = gr.Image(type="pil").style(height=150)
|
133 |
+
livness_result_output = gr.HTML()
|
|
|
|
|
134 |
|
135 |
+
check_liveness_button.click(check_liveness, inputs=live_image_input, outputs=[liveness_face_output, livness_result_output])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|