
# YuzID

**YuzID** is a Flutter plugin for face identification and detection, powered by **Google ML Kit** technology.  
It works on both **Android** and **iOS**, and provides passive liveness detection by scanning the user's face.

![Pub Version](https://img.shields.io/pub/v/yuz_id)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)


**Screenshot**

![Screenshot](screenshots/yuz_id_1.png)
![Screenshot](screenshots/yuz_id_2.png)
![Screenshot](screenshots/yuz_id_3.png)



## Features

- Real-time face detection
- Head position tracking
- Eyes and mouth open/closed detection
- Powered by **Google ML Kit**
- Supports Uzbek and English languages

---

##  Usage
```sh
import 'package:yuz_id/yuz_id.dart';

 Future<String?> runYuzID() async {
    String? photoData;
    
    try {
      photoData = await YuzID.instance.runYuzID(lang: "uz");
    } catch (e) {
      photoData = "";
      print("Something went wrong: $e");
    }
    
    return photoData;
  }
  ```

##  Installation
Add this to your `pubspec.yaml`:
```sh
dependencies:
  yuz_id: latest_version
```
Or install it via command line:
```sh
flutter pub add yuz_id
```

**iOS**

Add the required camera permission to your Info.plist:

```xml
<plist version="1.0">
    <dict>
        <!-- Add these two elements: -->
        <key>NSCameraUsageDescription</key>
        <string>App needs camera access for YuzID</string>
        <!-- ... -->
    </dict>
</plist>
```
Ensure your minimum iOS version is set to 13 or higher in your ios/Podfile:

```ruby
platform :ios, '13.0'

```

**Android**

Add the required permissions and activities to your AndroidManifest.xml:
```
<uses-permission android:name="android.permission.CAMERA" />

<application
...
        <activity
            android:name="uz.elusm.yuzid.YuzIDConnectorActivity"
            android:exported="true"/>
        <activity
            android:name="uz.face.detection.ui.FaceDetectionActivity"
            android:exported="true"/>
    </application>
```