Skip to content

kby-ai/Palmprint-Recognition-Docker

Repository files navigation

🤗 Hugging Face - Here

📚 Product & Resources - Here

🛟 Help Center - Here

💼 KYC Verification Demo - Here

🙋‍♀️ Docker Hub - Here

sudo docker pull kbyai/palmprint-recognition:latest
sudo docker run -v ./license.txt:/root/kby-ai-palmprint/license.txt -p 8081:8080 -p 9001:9000 kbyai/palmprint-recognition:latest

Palmprint Recognition-Docker

Overview

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

In this repo, we integrated KBY-AI's palmprint 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
➡️ Palmprint Recognition - Linux Palmprint Comparison Linux SDK Available
2 Palmprint Recognition - Docker Palmprint Comparison Docker Image Available
3 Palmvein Recognition - Linux Palmvein Comparison Linux SDK Developing
4 Palmprint Recognition - Android Palmprint Comparison Android SDK Available
5 Palmprint Recognition - iOS Palmprint Comparison iOS SDK Developing

To get more products, please visit products here:

Try the API

Online Demo

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

Please select tab 'Palmprint Recognition` for this SDK

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://89.116.159.229:8084/compare_palmprint.

  • Test with a base64-encoded image: Send a POST request to http://89.116.159.229:8084/compare_palmprint_base64.

    You can download the Postman collection to easily access and use these endpoints. click here

    image

SDK License

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

  • The code below shows how to use the license:

    machineCode = encoder.getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
    try:
    with open(licensePath, 'r') as file:
    license = file.read()
    except IOError as exc:
    print("failed to open license.txt: ", exc.errno)
    print("\nlicense: ", license)
    ret = encoder.setActivation(license.encode('utf-8'))

  • To request the license, please provide us with the machine code obtained from the getMachineCode function.

Please contact us:

🧙Email: [email protected]
🧙Telegram: @kbyai
🧙WhatsApp: +19092802609
🧙Skype: live:.cid.66e2522354b1049b
🧙Facebook: https://www.facebook.com/KBYAI

How to run

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: OpenVINO™ Runtime (Version: 2022.3)

2. Setup and Test

  • Clone the project:

    git clone https://github.com/kby-ai/Palmprint-Recognition-Docker.git
    cd Palmprint-Recognition-Docker
  • Build the Docker image:

    sudo docker build --pull --rm -f Dockerfile -t kby-ai-palmprint:latest .
  • Run the Docker container:

    sudo docker run -v ./license.txt:/root/kby-ai-palmprint/license.txt -p 8081:8080 -p 9001:9000 kby-ai-palmprint
  • Send us the machine code and then we will give you a license key to make the SDK activate.

    After that, update the license.txt file by overwriting the license key that you received. Then, run the Docker container again.

    image

    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/compare_palmprint.

    Test with a base64-encoded image: Send a POST request to http://{xx.xx.xx.xx}:8081/compare_palmprint_base64.

    You can download the Postman collection to easily access and use these endpoints. click here

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

  • Import SDK python package
    import handtool
  • Create new object for using SDK
    config = handtool.EncoderConfig()
    encoder = handtool.create_encoder(config)  
  • Obtain the machine code to activate and request a license
    machineCode = encoder.getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
  • Activate the SDK using the license key
    ret = encoder.setActivation(license.encode('utf-8'))
    print("\nactivation: ", ret)
    Once ret value is zero, SDK can get work started

2. APIs

  • Hand Detection

    The SDK provides a single API for detecting hands, determining hand landmark.
    The function can be used as follows:

    hand_type, x1, y1, x2, y2, detect_state = encoder.detect_using_bytes(img)
    roi = mat_to_bytes(get_roi(img, hand_type, x1, y1, x2, y2))
    • hand_type: it indicates hand type value, 0 value: left hand, 1 value: right hand.
    • x1, y1, x2, y2: hand landmark points to get ROI image.
    • roi: hand ROI(Region Of Interest) image to get palm feature.
  • Create Feature encode_using_bytes function returns palmprint feature against ROI data.</br.

    palmprint = encoder.encode_using_bytes(roi)
    • roi: hand ROI(Region Of Interest) image to get palm feature.
    • palmprint: palmprint feature calculated from hand ROI data.
  • Similiarity The compare_to function takes two palmprint features as a parameter and returns score value to determine whether 2 input hands are from the same or different.

    one_palmprint_code = encoder.encode_using_bytes(roi1)
    another_palmprint_code = encoder.encode_using_bytes(roi2)
    score = one_palmprint_code.compare_to(another_palmprint_code)

3. Threshold

The threshold is 0.15 as a default.

threshold = 0.15

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published