> For the complete documentation index, see [llms.txt](https://doc.faceplugin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.faceplugin.com/products/palm-recognition-sdk/open-source-palm-recognition-sdk.md).

# Open Source

Faceplugin open-source Palm Recognition SDK. On-premise Python Anaconda sample for RGB-camera palm matching. extract\_roi, extract\_features, compare\_two\_images. Not a commercial face SDK.

### Code <a href="#setup" id="setup"></a>

{% embed url="<https://github.com/Faceplugin-ltd/Palm-Recognition>" %}

### Overview <a href="#setup" id="setup"></a>

This page is the **open-source Palm Recognition** Python sample. It matches palms from a standard **RGB camera** on **your** machine. It is **not** the commercial [Face Recognition SDK](/products/face-recognition-sdk.md), **not** Face Liveness, and **not** document OCR.

Unlike cloud palm APIs, processing stays local. No biometric data is sent to Faceplugin.

### Setup <a href="#setup" id="setup"></a>

Please download anaconda on your computer and install it. We used Windows machine without GPU for testing

1. Create anaconda environment

```
conda create -n palm python=3.9
```

2. Activate the environment

```
conda activate palm
```

3. Install dependencies

```
pip install torch torchvision torchaudio
pip install opencv-python
pip install tqdm
pip install scikit-image
pip install mediapipe
```

4. Compare two palm images in the `test_images` directory

```
python main.py
```

### APIs and Parameters

* **classify\_hand(mp\_hands, hand\_landmarks, image\_width):** determine if the hand is left hand or right hand
* **extract\_roi(hands, mp\_hands, img\_path):** extract region of interest from the palm image for template matching
* **extract\_features(mp\_hands, hands, path: str):** extract template from the plam image specified by the path parameter
* **compare\_two\_images(mp\_hands, hands, image\_path1, image\_path2, similarity\_threshold=0.8):** compare two hand images to determine if they are the same hand or not.

### FAQ

**Is this a Faceplugin commercial SDK?** No. It is a public GitHub sample. There is no license key / Docker HTTP API on this page.

**Can I use it for face matching?** No. Use [Face Recognition](/products/face-recognition-sdk.md).

### Related documentation

* [Palm Recognition SDK](/products/palm-recognition-sdk.md) · [Face Recognition SDK](/products/face-recognition-sdk.md) · [Glossary](/help/resources/glossary.md)
* [Request a License](/help/request-a-license-and-support.md) · [Choose a product](/getting-started/choose-a-product.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.faceplugin.com/products/palm-recognition-sdk/open-source-palm-recognition-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
