Spaces:
Running
Running
Update demo.py
Browse files
demo.py
CHANGED
@@ -5,22 +5,22 @@ import io
|
|
5 |
import cv2
|
6 |
import numpy as np
|
7 |
|
8 |
-
|
9 |
|
10 |
-
def
|
11 |
-
global
|
12 |
|
13 |
-
|
14 |
|
15 |
-
url = "http://127.0.0.1:8080/
|
16 |
files = {'file1': open(frame1, 'rb'), 'file2': open(frame2, 'rb')}
|
17 |
|
18 |
r = requests.post(url=url, files=files)
|
19 |
|
20 |
html = None
|
21 |
|
22 |
-
compare_result = r.json().get('
|
23 |
-
compare_similarity = r.json().get('
|
24 |
|
25 |
html = ("<table>"
|
26 |
"<tr>"
|
@@ -42,7 +42,7 @@ def compare_palmprint(frame1, frame2):
|
|
42 |
with gr.Blocks() as demo:
|
43 |
gr.Markdown(
|
44 |
"""
|
45 |
-
# KBY-AI Palm-
|
46 |
We offer SDKs for face recognition, liveness detection(anti-spoofing), ID card recognition and ID document liveness detection.
|
47 |
We also specialize in providing outsourcing services with a variety of technical stacks like AI(Computer Vision/Machine Learning), Mobile apps, and web apps.
|
48 |
|
@@ -51,30 +51,30 @@ with gr.Blocks() as demo:
|
|
51 |
"""
|
52 |
)
|
53 |
|
54 |
-
with gr.TabItem("
|
55 |
gr.Markdown(
|
56 |
"""
|
57 |
-
##### Docker Hub - https://hub.docker.com/r/kbyai/
|
58 |
```bash
|
59 |
-
sudo docker pull kbyai/
|
60 |
-
sudo docker run -v ./license.txt:/
|
61 |
```
|
62 |
"""
|
63 |
)
|
64 |
with gr.Row():
|
65 |
with gr.Column():
|
66 |
-
|
67 |
-
gr.Examples(['
|
68 |
-
inputs=
|
69 |
-
|
70 |
with gr.Column():
|
71 |
-
|
72 |
-
gr.Examples(['
|
73 |
-
inputs=
|
74 |
with gr.Column():
|
75 |
compare_result_output = gr.HTML(label='Result')
|
76 |
|
77 |
-
|
78 |
gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fweb.kby-ai.com%2F"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fweb.kby-ai.com%2F&label=VISITORS&countColor=%23263759" /></a>')
|
79 |
|
80 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
5 |
import cv2
|
6 |
import numpy as np
|
7 |
|
8 |
+
palmvein_count = 0
|
9 |
|
10 |
+
def palmvein(frame1, frame2):
|
11 |
+
global palmvein_count
|
12 |
|
13 |
+
palmvein_count = palmvein_count + 1
|
14 |
|
15 |
+
url = "http://127.0.0.1:8080/palmvein"
|
16 |
files = {'file1': open(frame1, 'rb'), 'file2': open(frame2, 'rb')}
|
17 |
|
18 |
r = requests.post(url=url, files=files)
|
19 |
|
20 |
html = None
|
21 |
|
22 |
+
compare_result = r.json().get('result')
|
23 |
+
compare_similarity = r.json().get('score')
|
24 |
|
25 |
html = ("<table>"
|
26 |
"<tr>"
|
|
|
42 |
with gr.Blocks() as demo:
|
43 |
gr.Markdown(
|
44 |
"""
|
45 |
+
# KBY-AI Palm-Vein Recognition
|
46 |
We offer SDKs for face recognition, liveness detection(anti-spoofing), ID card recognition and ID document liveness detection.
|
47 |
We also specialize in providing outsourcing services with a variety of technical stacks like AI(Computer Vision/Machine Learning), Mobile apps, and web apps.
|
48 |
|
|
|
51 |
"""
|
52 |
)
|
53 |
|
54 |
+
with gr.TabItem("PalmVein Recognition"):
|
55 |
gr.Markdown(
|
56 |
"""
|
57 |
+
##### Docker Hub - https://hub.docker.com/r/kbyai/palmvein-recognition
|
58 |
```bash
|
59 |
+
sudo docker pull kbyai/palmvein-recognition:latest
|
60 |
+
sudo docker run -v ./license.txt:/home/openvino/kby-ai-palmvein/license.txt -p 8081:8080 -p 9001:9000 kbyai/palmvein-recognition:latest
|
61 |
```
|
62 |
"""
|
63 |
)
|
64 |
with gr.Row():
|
65 |
with gr.Column():
|
66 |
+
compare_palmvein_input1 = gr.Image(type='filepath')
|
67 |
+
gr.Examples(['palmvein_examples/1.jpg', 'palmvein_examples/3.jpg', 'palmvein_examples/5.jpg', 'palmvein_examples/7.jpg'],
|
68 |
+
inputs=compare_palmvein_input1)
|
69 |
+
compare_palmvein_button = gr.Button("Compare Hand")
|
70 |
with gr.Column():
|
71 |
+
compare_palmvein_input2 = gr.Image(type='filepath')
|
72 |
+
gr.Examples(['palmvein_examples/2.jpg', 'palmvein_examples/4.jpg', 'palmvein_examples/6.jpg', 'palmvein_examples/8.jpg'],
|
73 |
+
inputs=compare_palmvein_input2)
|
74 |
with gr.Column():
|
75 |
compare_result_output = gr.HTML(label='Result')
|
76 |
|
77 |
+
compare_palmvein_button.click(palmvein, inputs=[compare_palmvein_input1, compare_palmvein_input2], outputs=[compare_result_output])
|
78 |
gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fweb.kby-ai.com%2F"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fweb.kby-ai.com%2F&label=VISITORS&countColor=%23263759" /></a>')
|
79 |
|
80 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|