|
1 |
| -# Face-SDK-iOS-Demo |
| 1 | +<a href="https://recognito.vision" style="display: flex; align-items: center;"> |
| 2 | + <img src="https://github.com/Recognito-Vision/Face-SDK-Linux-Demos/assets/153883841/b82f5c35-09d0-4064-a252-4bcd14e22407"/> |
| 3 | +</a><br/> |
| 4 | + |
| 5 | +# Face Recognition, Liveness Detection, Pose Estimation iOS SDK Demo |
| 6 | +<p align="center"> |
| 7 | + <img alt="" src="https://recognito.vision/wp-content/uploads/2024/03/NIST.png" width=90%/> |
| 8 | +</p> |
| 9 | +<p align="center" style="font-size: 24px; font-weight: bold;"> |
| 10 | + <a href="https://pages.nist.gov/frvt/html/frvt11.html" target="_blank"> |
| 11 | + Latest NIST FRVT Report |
| 12 | + </a> |
| 13 | +</p> |
| 14 | + |
| 15 | + |
| 16 | +This repository contains a demonstration of Recognito's face recognition SDK for iOS. |
| 17 | +The SDK includes advanced features such as face recognition, liveness detection, and pose estimation. |
| 18 | +Recognito's face recognition algorithm has been ranked as the **Top 1 in the NIST FRVT** (Face Recognition Vendor Test). |
| 19 | + |
| 20 | +For more details and documentation, visit [https://docs.recognito.vision/](https://docs.recognito.vision/). |
| 21 | + |
| 22 | +## <img src="https://github.com/Recognito-Vision/Face-SDK-Linux-Demos/assets/153883841/d0991c83-44f0-4d38-bcc8-74376ce93ded" alt="feature" width="25"> Features |
| 23 | +- **Face Recognition:** Identify and verify individuals by comparing their facial features. |
| 24 | +- **Liveness Detection:** Determine whether a face is live or spoofed to prevent fraud in authentication processes. |
| 25 | +- **Pose Estimation:** Estimate the pose of a detected face, including Yaw, Roll, Pitch |
| 26 | + |
| 27 | +### - Additional Features |
| 28 | +- **NIST FRVT Top 1 Algorithm:** Utilize the top-ranked face recognition algorithm from the NIST FRVT for accurate and reliable results. |
| 29 | +- **On-premise:** Operate entirely within your infrastructure, ensuring data privacy and security. |
| 30 | +- **Real-time:** Perform face recognition, liveness detection, and pose estimation with minimal latency. |
| 31 | +- **Fully-offline:** Function without the need for an internet connection, ensuring reliability and data privacy. |
| 32 | + |
| 33 | +## <img src="https://github.com/Recognito-Vision/Face-SDK-Android-Demo/assets/153883841/6d34f50e-df5a-4d2a-8ce6-a38b8203d3e6" alt="youtube" width="25"> Demo Video |
| 34 | +[<img src="https://github.com/Recognito-Vision/Face-SDK-Android-Demo/assets/153883841/532c2717-9249-491e-8206-bf16caadb18b" width="70%">](https://www.youtube.com/watch?v=9HM70PFa4lQ) |
| 35 | + |
| 36 | +Recognito Youtube Channel: [youtube.com/@Recognito-Ltd](https://www.youtube.com/@Recognito-Ltd) |
| 37 | +<p align="center"> |
| 38 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/44163563-4d5b-47bb-b58e-df01581209ce" width="16%" /> |
| 39 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/f29ca2b4-e55b-4098-aec0-581a05240ef8" width="16%" /> |
| 40 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/6fa1d72c-494d-43d9-9868-fcb5da0046e6" width="16%" /> |
| 41 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/a7668fcd-fb5c-4b9c-b08d-9da13e51ab1b" width="16%" /> |
| 42 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/2bc7a269-8653-4f5e-8291-fd5179f9c225" width="16%" /> |
| 43 | + <img src="https://github.com/Recognito-Vision/Face-SDK-iOS-Demo/assets/153883841/3b0e1426-87e8-40fc-98f6-92ff4c699511" width="16%" /> |
| 44 | +</p> |
| 45 | + |
| 46 | +## <img src="https://github.com/Recognito-Vision/Face-SDK-Android-Demo/assets/153883841/05f9ac6c-1224-46a9-8c74-04b8f8cfe5ab" alt="SDK API" width="25"> SDK Integration |
| 47 | +To use the Recognito SDK in your iOS project, follow these steps: |
| 48 | +#### 1. Add `facesdk.framework` into the project |
| 49 | +- Copy and add the SDK framework to your iOS project. |
| 50 | + |
| 51 | +- Add the following dependency to your `build.gradle` and `settings.gradle` files: |
| 52 | + https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/601379c51970400b5c90972854b3468beef683ea/app/build.gradle#L50-L52 |
| 53 | + https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/601379c51970400b5c90972854b3468beef683ea/settings.gradle#L17-L19 |
| 54 | + |
| 55 | +#### 2. Application License (One-Time License) |
| 56 | +- For trial license, share your application ID. |
| 57 | + https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/601379c51970400b5c90972854b3468beef683ea/app/build.gradle#L6-L15 |
| 58 | + <div style="display: flex; align-items: center;"> |
| 59 | + <a target="_blank" href="mailto:hello@recognito.vision"><img src="https://img.shields.io/badge/email-hassan@recognito.vision-blue.svg?logo=gmail " alt="www.recognito.vision"></a> |
| 60 | + <a target="_blank" href="https://wa.me/+14158003112"><img src="https://img.shields.io/badge/whatsapp-+14158003112-blue.svg?logo=whatsapp " alt="www.recognito.vision"></a> |
| 61 | + <a target="_blank" href="https://t.me/recognito_vision"><img src="https://img.shields.io/badge/telegram-@recognito__vision-blue.svg?logo=telegram " alt="www.recognito.vision"></a> |
| 62 | + <a target="_blank" href="https://join.slack.com/t/recognito-workspace/shared_invite/zt-2d4kscqgn-"><img src="https://img.shields.io/badge/slack-recognito__workspace-blue.svg?logo=slack " alt="www.recognito.vision"></a> |
| 63 | + </div> |
| 64 | + |
| 65 | +- Add your license to `assets/license` file: |
| 66 | + https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/601379c51970400b5c90972854b3468beef683ea/app/src/main/assets/license?plain=1#L1-L5 |
| 67 | +- Initialize SDK with license. |
| 68 | + https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/601379c51970400b5c90972854b3468beef683ea/app/src/main/java/com/bio/facerecognition/MainActivity.kt#L39-L47 |
| 69 | + |
| 70 | + Initialization status codes: |
| 71 | + |
| 72 | + | Code | Status | |
| 73 | + |:------:|------| |
| 74 | + |0|Activate SDK successfully| |
| 75 | + |-1|License Key Error| |
| 76 | + |-2|License AppID Error| |
| 77 | + |-3|License Expired| |
| 78 | + |-4|Activate Error| |
| 79 | + |-5|Init SDK Error| |
| 80 | +#### 3. APIs of SDK |
| 81 | +##### - Activate SDK |
| 82 | +```java |
| 83 | +public static native int setActivation(String var0); |
| 84 | +``` |
| 85 | +Parameters |
| 86 | +- `var0`: The license string. |
| 87 | +- Return Value: An integer representing the SDK activation status code. |
| 88 | +<br/> |
| 89 | + |
| 90 | +##### - Initiate SDK |
| 91 | +```java |
| 92 | +public static native int init(AssetManager var0); |
| 93 | +``` |
| 94 | +Parameters |
| 95 | +- `var0`: An instance of AssetManager used to access application assets. |
| 96 | +- Return Value: An integer representing the initialization status code. |
| 97 | +<br/> |
| 98 | + |
| 99 | +##### - Convert YUV camera frame to Bitmap image |
| 100 | +```java |
| 101 | +public static native Bitmap yuv2Bitmap(byte[] nv21, int width, int height, int orientation); |
| 102 | +``` |
| 103 | +Parameters |
| 104 | +- `nv21`: Byte array representing the YUV image data in NV21 format. |
| 105 | +- `width`: Width of the image. |
| 106 | +- `height`: Height of the image. |
| 107 | +- `orientation`: Orientation of the image |
| 108 | + |
| 109 | + | Value | Orientation | |
| 110 | + |:----:|----| |
| 111 | + |1|No processing| |
| 112 | + |2|Flip horizontally| |
| 113 | + |3|Flip horizontally first and then flip vertically| |
| 114 | + |4|vertical flip| |
| 115 | + |5|transpose| |
| 116 | + |6|Rotate 90° clockwise| |
| 117 | + |7|Horizontal and vertical flip --> transpose| |
| 118 | + |8|Rotate 90° counterclockwise| |
| 119 | +- Return Value: A Bitmap object representing the converted image. |
| 120 | +<br/> |
| 121 | + |
| 122 | +##### - Detect Face |
| 123 | +```java |
| 124 | +public static native List<FaceBox> faceDetection(Bitmap var0, FaceDetectionParam var1); |
| 125 | +``` |
| 126 | +Parameters |
| 127 | +- `var0`: The Bitmap image. |
| 128 | +- `var1`: Parameters for face detection |
| 129 | +```java |
| 130 | +public class FaceDetectionParam { |
| 131 | + public boolean check_liveness = false; |
| 132 | + public int check_liveness_level = 0; // 0: more accurate model, 1: lighter model |
| 133 | +} |
| 134 | +``` |
| 135 | +- Return Value: A list of FaceBox objects representing the detected faces. |
| 136 | +```java |
| 137 | +public class FaceBox { |
| 138 | + public int x1; |
| 139 | + public int y1; |
| 140 | + public int x2; |
| 141 | + public int y2; |
| 142 | + public float liveness; |
| 143 | + public float yaw; |
| 144 | + public float roll; |
| 145 | + public float pitch; |
| 146 | +} |
| 147 | +``` |
| 148 | +<br/> |
| 149 | + |
| 150 | +##### - Extract face feature |
| 151 | +```java |
| 152 | +public static native byte[] templateExtraction(Bitmap var0, FaceBox var1); |
| 153 | +``` |
| 154 | +Parameters |
| 155 | +- `var0`: The Bitmap image |
| 156 | +- `var1`: The bounding box (`FaceBox`) of the detected face. |
| 157 | +- Return Value: A byte array representing the extracted template from the face. |
| 158 | +<br/> |
| 159 | + |
| 160 | +##### - Calculate similarity between two face features |
| 161 | +```java |
| 162 | +public static native float similarityCalculation(byte[] var0, byte[] var1); |
| 163 | +``` |
| 164 | +Parameters |
| 165 | +- `var0`: The byte array representing the first face template. |
| 166 | +- `var1`: The byte array representing the second face template. |
| 167 | +- Return Value: A float value representing the similarity score between the two face templates. |
| 168 | +<br/> |
| 169 | + |
| 170 | +## <img src="https://github.com/Recognito-Vision/Face-SDK-Linux-Demos/assets/153883841/78c5efee-15f3-4406-ab4d-13fd1182d20c" alt="contact" width="25"> Support |
| 171 | +For any questions, issues, or feature requests, please contact our support team. |
| 172 | + |
| 173 | +<div style="display: flex; align-items: center;"> |
| 174 | + <a target="_blank" href="mailto:hello@recognito.vision"><img src="https://img.shields.io/badge/email-hassan@recognito.vision-blue.svg?logo=gmail " alt="www.recognito.vision"></a> |
| 175 | + <a target="_blank" href="https://wa.me/+14158003112"><img src="https://img.shields.io/badge/whatsapp-+14158003112-blue.svg?logo=whatsapp " alt="www.recognito.vision"></a> |
| 176 | + <a target="_blank" href="https://t.me/recognito_vision"><img src="https://img.shields.io/badge/telegram-@recognito__vision-blue.svg?logo=telegram " alt="www.recognito.vision"></a> |
| 177 | + <a target="_blank" href="https://join.slack.com/t/recognito-workspace/shared_invite/zt-2d4kscqgn-"><img src="https://img.shields.io/badge/slack-recognito__workspace-blue.svg?logo=slack " alt="www.recognito.vision"></a> |
| 178 | +</div> |
| 179 | +<br/> |
| 180 | +<p align="center"> |
| 181 | +   <a href="https://recognito.vision" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/03/recognito_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 182 | + <a href="https://www.linkedin.com/company/recognito-vision" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/03/linkedin_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 183 | + <a href="https://huggingface.co/Recognito" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/03/hf_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 184 | + <a href="https://github.com/Recognito-Vision" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/03/github_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 185 | + <a href="https://hub.docker.com/u/recognito" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/03/docker_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 186 | + <a href="https://www.youtube.com/@Recognito-Ltd" style="display: flex; align-items: center;"><img src="https://recognito.vision/wp-content/uploads/2024/04/youtube_64_cl.png" style="width: 32px; margin-right: 5px;"/></a> |
| 187 | +</p> |
0 commit comments