Skip to content

Palmvein Recognition Linux: palm-vein recognition, palmvein identity, palmvein comparison, palmvein matching, hand landmark, hand tracking, hand detection, palm vascular

License

Notifications You must be signed in to change notification settings

kby-ai/Palmvein-Recognition-Docker

Repository files navigation

Our facial recognition algorithm is globally top-ranked by NIST in the FRVT 1:1 leaderboards. badge

Latest NIST FRVT evaluation report 2024-12-20

FRVT Sheet

🆔 ID Document Liveness Detection - Linux - Here badge

🤗 Hugging Face - Here

📚 Product & Resources - Here

🛟 Help Center - Here

💼 KYC Verification Demo - Here

🙋‍♀️ Docker Hub - Here

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

Palmvein-Recognition-Docker

Overview

This repository demonstrates an efficient and accurate palmvein recognition technology by implementing palm-vein comparison based on palmvein feature extraction and face matching algorithm, which was implemented via a Dockerized Flask API.
It includes features that allow for testing plamvein recognition between two images using both image files and base64-encoded images.

In this repo, we integrated KBY-AI's palmvein recognition solution into Linux Server SDK by wrapping with docker image.
We can customize the SDK to align with customer's specific requirements.

◾PalmRecognitionSDK Product List

No. Repository SDK Details Status
1 Palmprint Recognition - Linux Palmprint Comparison Linux SDK Available
2 Palmprint Recognition - Docker Palmprint Comparison Docker Image Available
➡️ Palmvein Recognition - Linux Palmvein Comparison Linux SDK Available
4 Palmprint Recognition - Android Palmprint Comparison Android SDK Available
5 Palmvein Recognition - Docker Palmvein Comparison Docker Image Available

To get more products, please visit products here:

Try the API

Online Demo

This SDK can be tested on online test demo page here:

image

Postman

The API can be evaluated through Postman tool. Here are the endpoints for testing:

  • Test with an image file: Send a POST request to http://127.0.0.1:8081/palmvein.
  • Test with a base64-encoded image: Send a POST request to http://127.0.0.1:8081/palmvein_base64. image

SDK License

This project demonstrates KBY-AI's Palmvein Recognition Server SDK, which requires a license per machine.

  • The code below shows how to use the license:
    machineCode = getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
    try:
    with open(licensePath, 'r') as file:
    license = file.read().strip()
    except IOError as exc:
    print("failed to open license.txt: ", exc.errno)
    print("\nlicense: ", license)
    ret = setActivation(license.encode('utf-8'))
    print("\nactivation: ", ret)
  • To request the license, please provide us with the machine code obtained from the getMachineCode function.

Please contact us:

🧙Email: contact@kby-ai.com
🧙Telegram: @kbyai
🧙WhatsApp: +19092802609
🧙Discord: KBY-AI
🧙Teams: KBY-AI

1. System Requirements

  • CPU: 2 cores or more (Recommended: 2 cores)
  • RAM: 4 GB or more (Recommended: 8 GB)
  • HDD: 4 GB or more (Recommended: 8 GB)
  • OS: Ubuntu 20.04 or later
  • Dependency: ncnn (Version: 2024.12.26)

2. Setup and Test

  • Clone the project:
    git clone https://github.com/kby-ai/Palmvein-Recognition-Docker.git
    cd Palmvein-Recognition-Docker
  • Build the Docker image:
    sudo docker build --pull --rm -f Dockerfile -t kby-ai-palmvein:latest .
  • Read machine code
    sudo docker run -e LICENSE="xxxxx" kby-ai-palmvein:latest
    
  • Send us machine code obtained. image
  • Update the license.txt file by overwriting the license key that you received from KBY-AI team.
  • Run the Docker container:
    sudo docker run -v ./license.txt:/home/openvino/kby-ai-palmvein/license.txt -p 8081:8080 -p 9001:9000 kby-ai-palmvein:latest
    image
  • Here are the endpoints to test the API through Postman: Test with an image file: Send a POST request to http://{xx.xx.xx.xx}:8081/palmvein.
    Test with a base64-encoded image: Send a POST request to http://{xx.xx.xx.xx}:8081/palmvein.

3. Execute the Gradio demo

  • Setup Gradio Ensure that the necessary dependencies are installed.
    Gradio requires Python 3.6 or above.
    Install Gradio using pip by running the following command:
    pip install gradio
  • Run the demo with the following command:
    cd gradio
    python demo.py
  • SDK can be tested on the following URL: http://127.0.0.1:9000

About SDK

1. Initializing the SDK

  • Obtain the machine code to activate and request a license
    machineCode = getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
  • Activate the SDK using the license key
    ret = setActivation(license.encode('utf-8'))
    print("\nactivation: ", ret)
    Once ret value is zero, SDK can get work started

2. APIs

  • ROI Extraction The SDK provides a single API for detecting hands and extracting ROI from the whole hand image(palmvein).
    The function can be used as follows:
    roi, label = get_roi_image(cv2.flip(image, 1))
    • image: input image.
    • label: Left hand or Right one.
    • roi: hand ROI(Region Of Interest) image to get palm feature.
  • Create Feature getFeature function returns palmvein feature against ROI data.
    cnt = getFeature(roi_byte, len(roi_byte), feature_array)
    • roi_byte: roi image in byte format(image should be converted to byte format by function mat_to_byets()).
    • feature_array: palmvein feature extracted from hand ROI data.
  • Similiarity The getScore() function takes two palmvein features as arguments and returns score value to determine whether 2 input hands are from the same or different.
    score = getScore(feature_array1, cnt1, feature_array2, cnt2)

3. Threshold

The threshold is 0.65 as a default.

if score >= 0.65:
result = "Same Hand !"

About

Palmvein Recognition Linux: palm-vein recognition, palmvein identity, palmvein comparison, palmvein matching, hand landmark, hand tracking, hand detection, palm vascular

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published