# FaceSDK - Windows

{% hint style="success" %}
Our SDK is fully on-premise, processing all happens on hosting server and no data leaves your server.
{% endhint %}

## Installation

### Prerequisites

* Python 3.6+
* Windows
* CPU: 2 cores or more
* RAM: 8GB or more

### Installation Steps

1. **Download the Face Recognition Windows Server Installer**

   Download the Server installer for your operating system from the following link:

   [Download the On-premise Server Installer](https://drive.google.com/file/d/1cNaJETo2liaAn0ijXqM45B6sNEhbNj6L/view?usp=sharing)
2. **Install the On-premise Server**

   Run the installer and follow the on-screen instructions to complete the installation
3. **Request License and Update**\
   Run MIRequest.exe file to generate a license request file. You can find it here.\
   \
   Open it, generate a license request file, and send it to us via [email ](mailto:info@miniai.live)or [WhatsApp](https://wa.me/+19162702374). We will send the license based on your Unique Request file, then you can upload the license file to allow to use. Refer the below images.

```markdown
C:\Program Files\MiniAiLive\MiniAiLive-FaceSDK-WinServer
```

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2F6Aw8mePX2HHWAOTf7VEN%2Fimage.png?alt=media&#x26;token=4277133f-b9c1-4795-9d25-ac25dea3716c" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2Fh79tUDVp7pOQrjG9j1vn%2Fimage.png?alt=media&#x26;token=02b1ab2c-7be6-4de6-b812-c820386b931e" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2F2hny9Lp2S4mo0Fm3FijA%2Fimage.png?alt=media&#x26;token=bb53b282-50fc-4453-9666-7cc395d17f0c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2F0dNJmGHq33SIwZTSpwkD%2Fimage.png?alt=media&#x26;token=216c8c56-2707-48db-bfab-ddc47803c6d3" alt=""><figcaption></figcaption></figure>

4. **Verify Installation**\
   After installation, verify that the On-premise Server is correctly installed by checking the task manager

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2Fgd1lLSVV8zCzXxkSniwV%2Fimage.png?alt=media&#x26;token=f2c30b42-d9cb-45b7-bdcf-d26cba6cd9c3" alt="" width="563"><figcaption></figcaption></figure>

## API Reference

1. **Endpoint**

<mark style="color:green;">`POST`</mark> [`http://127.0.0.1:8083/api/face_detect`](http://127.0.0.1:8083/api/face_detect)  \<Face Detection, Face Attributes API>

* **Form Data:**
  * `image`: The image file (PNG, JPG, etc.) to be analyzed. This should be provided as a file upload

<figure><img src="https://github.com/user-attachments/assets/e05be690-f474-4ad5-b800-ea64ee763461" alt=""><figcaption></figcaption></figure>

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8083/api/face_detect_base64`  \<Face Detection, Face Attributes API>

* **Raw Data:**

  * `JSON Format`:&#x20;

  ```json
  {
      "image": "--base64 image data here--"
  }
  ```

<figure><img src="https://github.com/user-attachments/assets/70c50c55-3c39-4885-ab9f-8e0c34e525f0" alt=""><figcaption></figcaption></figure>

Other available endpoints here.

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8083/api/face_match`  <1:1, 1:N Face Matching API>

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8083/api/face_match_base64`  <1:1, 1:N Face Matching API>

2. **Response**

The API returns a JSON object with the recognized details from the input face image. Here is an example response

<figure><img src="https://559891175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZNwfjUfgEKAU8sqYBQl4%2Fuploads%2FRc1ya1agFDd6FNZBVd2X%2Fimage.png?alt=media&#x26;token=aa77a93e-bdb5-4d73-9bfb-1fcbc094696a" alt=""><figcaption></figcaption></figure>

## Testing API

### Gradio Demo

We have included a Gradio demo to showcase the capabilities of our Face Recognition SDK. Gradio is a Python library that allows you to quickly create user interfaces for machine learning models.

#### How to Run the Gradio Demo

1. **Install Gradio:**

   First, you need to install Gradio. You can do this using pip:

   ```json
   git clone https://github.com/MiniAiLive/FaceRecognition-Windows.git
   pip install -r requirement.txt
   cd gradio
   ```
2. **Run Gradio Demo:**

   ```
   python app.py
   ```

### Python Test API Example

To help you get started with using the API, here is a comprehensive example of how to interact with the Face Recognition API using Python. You can use API with another language you want to use like C++, C#, Ruby, Java, Javascript, and more

1. **Prerequisites**

* Python 3.6+
* `requests` library (you can install it using `pip install requests`)

2. **Example Script**

This example demonstrates how to send an image file to the API endpoint and process the response.

```
import requests

# URL of the web API endpoint
url = 'http://127.0.0.1:8083/api/face_detect'

# Path to the image file you want to send
image_path = './test_image.jpg'

# Read the image file and send it as form data
files = {'image': open(image_path, 'rb')}

try:
    # Send POST request
    response = requests.post(url, files=files)

    # Check if the request was successful
    if response.status_code == 200:
        print('Request was successful!')
        # Parse the JSON response
        response_data = response.json()
        print('Response Data:', response_data)
    else:
        print('Request failed with status code:', response.status_code)
        print('Response content:', response.text)

except requests.exceptions.RequestException as e:
    print('An error occurred:', e)
```

## Face & IDSDK Online Demo, Resources

| [![](https://camo.githubusercontent.com/806c4c9371684f21d03953dcc53853b790fa8440239f30681a21ce2cf2adcf92/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f6e65775f6769742d312d3330307836372e706e67)](https://github.com/MiniAiLive) | [![](https://camo.githubusercontent.com/28530427ea25f63b9ae20a1dce8d4a92ce76f67af276e92d5cf7ac370f335e08/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f6e65775f68756767696e672d312d3330307836372e706e67)](https://huggingface.co/MiniAiLive) | [![](https://camo.githubusercontent.com/514dcba45bbc416e9ff4d28794755408d015fcafca876e5ef3dc0321e80fa4c6/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f6e65775f67726164696f2d3330307836372e706e67)](https://demo.miniai.live/)                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [![](https://camo.githubusercontent.com/09f3ad9287d86c1c5839adbe83dd7cec21eb4778d845a7e36ad7e58fa64c5fd6/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f612d3330307837302e706e67)](https://docs.miniai.live/)                     | [![](https://camo.githubusercontent.com/3137c2356707552aa1332fea60196413ab2f89ced339c8fe4367e8167d04b16f/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f556e7469746c65642d312d3330307837302e706e67)](https://www.youtube.com/@miniailive)     | [![](https://camo.githubusercontent.com/c642d8abd48cbc0861511ae78bc53ad1c544f7bf59432790bba60a84df44e98a/68747470733a2f2f6d696e6961692e6c6976652f77702d636f6e74656e742f75706c6f6164732f323032342f31302f676f6f676c65706c61792d3330307836322e706e67)](https://play.google.com/store/apps/dev?id=5831076207730531667) |

## Our Products

<table><thead><tr><th width="74">No</th><th>Project</th><th>Feature</th></tr></thead><tbody><tr><td>1</td><td><a href="https://github.com/MiniAiLive/FaceRecognition-Linux">FaceRecognition-Linux</a></td><td>1:1 &#x26; 1:N Face Matching</td></tr><tr><td>2</td><td><a href="https://github.com/MiniAiLive/FaceRecognition-Windows">FaceRecognition-Windows</a></td><td>1:1 &#x26; 1:N Face Matching</td></tr><tr><td>3</td><td><a href="https://github.com/MiniAiLive/FaceRecognition-Docker">FaceRecognition-Docker</a></td><td>1:1 &#x26; 1:N Face Matching</td></tr><tr><td>4</td><td><a href="https://github.com/MiniAiLive/FaceRecognition-Android">FaceRecognition-Android</a></td><td>1:1 &#x26; 1:N Face Matching, 2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>5</td><td><a href="https://github.com/MiniAiLive/FaceRecognition-LivenessDetection-Windows">FaceRecognition-LivenessDetection-Windows</a></td><td>1:1 &#x26; 1:N Face Matching, 2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>6</td><td><a href="https://github.com/MiniAiLive/FaceLivenessDetection-Linux">FaceLivenessDetection-Linux</a></td><td>2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>7</td><td><a href="https://github.com/MiniAiLive/FaceLivenessDetection-Windows">FaceLivenessDetection-Windows</a></td><td>2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>8</td><td><a href="https://github.com/MiniAiLive/FaceLivenessDetection-Docker">FaceLivenessDetection-Docker</a></td><td>2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>9</td><td><a href="https://github.com/MiniAiLive/FaceLivenessDetection-Android">FaceLivenessDetection-Android</a></td><td>2D &#x26; 3D Face Passive LivenessDetection</td></tr><tr><td>10</td><td><a href="https://github.com/MiniAiLive/FaceMatching-Android">FaceMatching-Android</a></td><td>1:1 Face Matching</td></tr><tr><td>11</td><td><a href="https://github.com/MiniAiLive/FaceMatching-Windows">FaceMatching-Windows-Demo</a></td><td>1:1 Face Matching</td></tr><tr><td>12</td><td><a href="https://github.com/MiniAiLive/FaceAttributes-Android">FaceAttributes-Android</a></td><td>Face Attributes, Age &#x26; Gender Estimation</td></tr><tr><td>13</td><td><a href="https://github.com/MiniAiLive/ID-DocumentRecognition-Linux">ID-DocumentRecognition-Linux</a></td><td>IDCard, Passport, Driver License, Credit, MRZ Recognition</td></tr><tr><td>14</td><td><a href="https://github.com/MiniAiLive/ID-DocumentRecognition-Windows">ID-DocumentRecognition-Windows</a></td><td>IDCard, Passport, Driver License, Credit, MRZ Recognition</td></tr><tr><td>15</td><td><a href="https://github.com/MiniAiLive/ID-DocumentRecognition-Docker">ID-DocumentRecognition-Docker</a></td><td>IDCard, Passport, Driver License, Credit, MRZ Recognition</td></tr><tr><td>16</td><td><a href="https://github.com/MiniAiLive/ID-DocumentRecognition-Android">ID-DocumentRecognition-Android</a></td><td>IDCard, Passport, Driver License, Credit, MRZ Recognition</td></tr><tr><td>17</td><td><a href="https://github.com/MiniAiLive/ID-DocumentLivenessDetection-Linux">ID-DocumentLivenessDetection-Linux</a></td><td>ID Document LivenessDetection</td></tr><tr><td>18</td><td><a href="https://github.com/MiniAiLive/ID-DocumentLivenessDetection-Windows">ID-DocumentLivenessDetection-Windows</a></td><td>ID Document LivenessDetection</td></tr><tr><td>19</td><td><a href="https://github.com/MiniAiLive/ID-DocumentLivenessDetection-Docker">ID-DocumentLivenessDetection-Docker</a></td><td>ID Document LivenessDetection</td></tr></tbody></table>

## Request license

Feel free to [Contact US](https://www.miniai.live/contact/) to get a trial License. We are 24/7 online on WhatsApp: [+19162702374](https://wa.me/+19162702374).
