# API Reference

### get\_version

{% code overflow="wrap" %}

```python
def get_version() -> str:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="136"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>get_version</td></tr><tr><td><strong>Description</strong></td><td>Retrieves the SDK version information from a library.</td></tr><tr><td><strong>Input</strong></td><td>None</td></tr><tr><td><strong>Output</strong></td><td>The version string is returned as a standard Python string.</td></tr></tbody></table>

### get\_deviceid <a href="#get_device_id" id="get_device_id"></a>

{% code overflow="wrap" %}

```python
def get_deviceid() -> str:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="136"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>get_deviceid</td></tr><tr><td><strong>Description</strong></td><td>Retrieves the Hardware ID from a library.</td></tr><tr><td><strong>Input</strong></td><td>None</td></tr><tr><td><strong>Output</strong></td><td>The Hardware ID is returned as a standard Python string.</td></tr></tbody></table>

### init\_sdk

{% code overflow="wrap" %}

```python
def init_sdk(dict_path: str, online_key: str) -> int:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>init_sdk</td></tr><tr><td><strong>Description</strong></td><td>Initializes the SDK in online mode.</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>dict_path</strong> (str): Path to the engine binary files directory</li><li><strong>online_key</strong> (str): Online key string </li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>Status code indicating the result of the initialization.</p><ul><li>0: Success</li><li>Non-zero: Initialization failed</li></ul></td></tr></tbody></table>

### init\_sdk\_offline

{% code overflow="wrap" %}

```python
def init_sdk_offline(dict_path: str, offline_key_path: str) -> int:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>init_sdk_offline</td></tr><tr><td><strong>Description</strong></td><td>Initializes the SDK in offline mode.</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>dict_path</strong> (str): Path to the engine binary files directory</li><li><strong>offline_key</strong> (str): Path to the offline license key file</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>Status code indicating the result of the initialization.</p><ul><li>0: Success</li><li>Non-zero: Initialization failed</li></ul></td></tr></tbody></table>

### detect\_face\_rgb

{% code overflow="wrap" %}

```python
def detect_face_rgb(image: np.ndarray, width: int, height: int, face_bbox: np.ndarray, liveness_score: np.ndarray, angles: np.ndarray) -> int:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>detect_face_rgb</td></tr><tr><td><strong>Description</strong></td><td>Detects and analyzes face.</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>image</strong> (numpy.ndarray): Input image matrix</li><li><strong>width</strong> (int): Width of the input image</li><li><strong>height</strong> (int): Height of the input image</li><li><strong>face_bbox</strong> (numpy.ndarray): Face bounding box coordinates. Extracted face bbox will be stored</li><li><strong>liveness_score</strong> (numpy.ndarray): Liveness score of detected face</li><li><strong>angles</strong> (numpy.ndarray): Pitch, Yaw, Roll degree of detected face</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>Status code indicating the result of the liveness check.</p><ul><li>>0: Success</li><li>0: No Face</li><li>-1: SDK Activation Error</li><li>-2: SDK Initialization Error</li></ul></td></tr></tbody></table>

#### Liveness Score Values (Default Threshold is 0.5)
