File size: 3,203 Bytes
c5e21cb
 
 
 
 
 
224819c
48b21a3
c5e21cb
48b21a3
 
c5e21cb
48b21a3
c5e21cb
48b21a3
c5e21cb
 
 
 
 
 
48b21a3
 
c5e21cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48b21a3
c5e21cb
 
 
 
 
 
 
 
48b21a3
c5e21cb
 
48b21a3
c5e21cb
48b21a3
 
c5e21cb
 
 
 
 
48b21a3
 
 
 
c5e21cb
48b21a3
 
 
c5e21cb
 
 
48b21a3
c5e21cb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import gradio as gr
import requests
from PIL import Image
import io
import cv2
import numpy as np

palmvein_count = 0

def palmvein(frame1, frame2):
    global palmvein_count
    
    palmvein_count = palmvein_count + 1

    url = "http://127.0.0.1:8080/palmvein"
    files = {'file1': open(frame1, 'rb'), 'file2': open(frame2, 'rb')}

    r = requests.post(url=url, files=files)

    html = None

    compare_result = r.json().get('result')
    compare_similarity = r.json().get('score')

    html = ("<table>"
                "<tr>"
                    "<th>Compare Result</th>"
                    "<th>Value</th>"
                "</tr>"
                "<tr>"
                    "<td>Result</td>"
                    "<td>{compare_result}</td>"
                "</tr>"
                "<tr>"
                    "<td>Similarity</td>"
                    "<td>{compare_similarity}</td>"
                "</tr>"
                "</table>".format(compare_result=compare_result, compare_similarity=compare_similarity))

    return [html]

with gr.Blocks() as demo:
    gr.Markdown(
        """
    # KBY-AI Palm-Vein Recognition 
    We offer SDKs for face recognition, liveness detection(anti-spoofing), ID card recognition and ID document liveness detection. 
    We also specialize in providing outsourcing services with a variety of technical stacks like AI(Computer Vision/Machine Learning), Mobile apps, and web apps.
    
    ##### KYC Verification Demo - https://github.com/kby-ai/KYC-Verification-Demo-Android
    ##### ID Capture Web Demo - https://cap.kby-ai.com
    """
    )

    with gr.TabItem("PalmVein Recognition"):
        gr.Markdown(
            """
        ##### Docker Hub - https://hub.docker.com/r/kbyai/palmvein-recognition
        ```bash
        sudo docker pull kbyai/palmvein-recognition:latest
        sudo docker run -v ./license.txt:/home/openvino/kby-ai-palmvein/license.txt -p 8081:8080 -p 9001:9000 kbyai/palmvein-recognition:latest
        ```
        """
        )
        with gr.Row():
            with gr.Column():
                compare_palmvein_input1 = gr.Image(type='filepath')
                gr.Examples(['palmvein_examples/1.jpg', 'palmvein_examples/3.jpg', 'palmvein_examples/5.jpg', 'palmvein_examples/7.jpg'], 
                            inputs=compare_palmvein_input1)
                compare_palmvein_button = gr.Button("Compare Hand")
            with gr.Column():
                compare_palmvein_input2 = gr.Image(type='filepath')
                gr.Examples(['palmvein_examples/2.jpg', 'palmvein_examples/4.jpg', 'palmvein_examples/6.jpg', 'palmvein_examples/8.jpg'], 
                            inputs=compare_palmvein_input2)
            with gr.Column():
                compare_result_output = gr.HTML(label='Result')

        compare_palmvein_button.click(palmvein, inputs=[compare_palmvein_input1, compare_palmvein_input2], outputs=[compare_result_output])
    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>')

demo.launch(server_name="0.0.0.0", server_port=7860)