> 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/palm-recognition-sdk/open-source-palm-recognition-sdk.md).

# Open Source Palm Recognition

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](/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 `FP1.…` / Docker HTTP API on this page.

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

### Related documentation

* [Palm Recognition SDK](/palm-recognition-sdk.md) · [Face Recognition SDK](/face-recognition-sdk.md) · [Glossary](/resources/glossary.md)
* [Request a License](/request-a-license-and-support.md) · [Choose a product](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
