Skip to content

Commit 601379c

Browse files
Update README.md
1 parent 08506bf commit 601379c

File tree

1 file changed

+137
-4
lines changed

1 file changed

+137
-4
lines changed

README.md

Lines changed: 137 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,141 @@ Recognito's face recognition algorithm has been ranked as the **Top 1 in the NIS
5151
To use the Recognito SDK in your Android project, follow these steps:
5252
#### 1. Add `libfacesdk` into the project
5353
- Add the SDK folder to your Android project's directory.
54-
- Add the following dependencies to your `build.gradle` file:
55-
```groovy
56-
dependencies {
57-
implementation project(path: ':libfacesdk')
54+
- Add the following dependency to your `build.gradle` and `settings.gradle` files:
55+
56+
https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/main/app/build.gradle#L50-L52
57+
58+
https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/main/settings.gradle#L17-L19
59+
60+
#### 2. Application License (One-Time License)
61+
- For trial license, share your application ID.
62+
https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/main/app/build.gradle#L6-L15
63+
<div style="display: flex; align-items: center;">
64+
<a target="_blank" href="mailto:[email protected]"><img src="https://img.shields.io/badge/[email protected]?logo=gmail " alt="www.recognito.vision"></a>
65+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
66+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
67+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
68+
</div>
69+
70+
- Add your license to `assets/license` file:
71+
https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/main/app/src/main/assets/license#L1-L5
72+
- Initialize SDK with license.
73+
https://github.com/Recognito-Vision/Face-SDK-Android-Demo/blob/main/app/src/main/java/com/bio/facerecognition/MainActivity.kt#39-L47
74+
75+
Initialization status codes:
76+
77+
| Code | Status |
78+
|:------:|------|
79+
|0|Activate SDK successfully|
80+
|-1|License Key Error|
81+
|-2|License AppID Error|
82+
|-3|License Expired|
83+
|-4|Activate Error|
84+
|-5|Init SDK Error|
85+
#### 3. APIs of SDK
86+
##### - Activate SDK
87+
```java
88+
public static native int setActivation(String var0);
89+
```
90+
Parameters
91+
- `var0`: The license string.
92+
- Return Value: An integer representing the SDK activation status code.
93+
<br/>
94+
95+
##### - Initiate SDK
96+
```java
97+
public static native int init(AssetManager var0);
98+
```
99+
Parameters
100+
- `var0`: An instance of AssetManager used to access application assets.
101+
- Return Value: An integer representing the initialization status code.
102+
<br/>
103+
104+
##### - Convert YUV camera frame to Bitmap image
105+
```java
106+
public static native Bitmap yuv2Bitmap(byte[] nv21, int width, int height, int orientation);
107+
```
108+
Parameters
109+
- `nv21`: Byte array representing the YUV image data in NV21 format.
110+
- `width`: Width of the image.
111+
- `height`: Height of the image.
112+
- `orientation`: Orientation of the image
113+
114+
| Value | Orientation |
115+
|:----:|----|
116+
|1|No processing|
117+
|2|Flip horizontally|
118+
|3|Flip horizontally first and then flip vertically|
119+
|4|vertical flip|
120+
|5|transpose|
121+
|6|Rotate 90° clockwise|
122+
|7|Horizontal and vertical flip --> transpose|
123+
|8|Rotate 90° counterclockwise|
124+
- Return Value: A Bitmap object representing the converted image.
125+
<br/>
126+
127+
##### - Detect Face
128+
```java
129+
public static native List<FaceBox> faceDetection(Bitmap var0, FaceDetectionParam var1);
130+
```
131+
Parameters
132+
- `var0`: The Bitmap image.
133+
- `var1`: Parameters for face detection
134+
```java
135+
public class FaceDetectionParam {
136+
public boolean check_liveness = false;
137+
public int check_liveness_level = 0; // 0: more accurate model, 1: lighter model
58138
}
139+
```
140+
- Return Value: A list of FaceBox objects representing the detected faces.
141+
```java
142+
public class FaceBox {
143+
public int x1;
144+
public int y1;
145+
public int x2;
146+
public int y2;
147+
public float liveness;
148+
public float yaw;
149+
public float roll;
150+
public float pitch;
151+
}
152+
```
153+
<br/>
154+
155+
##### - Extract face feature
156+
```java
157+
public static native byte[] templateExtraction(Bitmap var0, FaceBox var1);
158+
```
159+
Parameters
160+
- `var0`: The Bitmap image
161+
- `var1`: The bounding box (`FaceBox`) of the detected face.
162+
- Return Value: A byte array representing the extracted template from the face.
163+
<br/>
164+
165+
##### - Calculate similarity between two face features
166+
```java
167+
public static native float similarityCalculation(byte[] var0, byte[] var1);
168+
```
169+
Parameters
170+
- `var0`: The byte array representing the first face template.
171+
- `var1`: The byte array representing the second face template.
172+
- Return Value: A float value representing the similarity score between the two face templates.
173+
<br/>
174+
175+
## <img src="https://github.com/Recognito-Vision/Face-SDK-Linux-Demos/assets/153883841/78c5efee-15f3-4406-ab4d-13fd1182d20c" alt="contact" width="25"> Support
176+
For any questions, issues, or feature requests, please contact our support team.
177+
178+
<div style="display: flex; align-items: center;">
179+
<a target="_blank" href="mailto:[email protected]"><img src="https://img.shields.io/badge/[email protected]?logo=gmail " alt="www.recognito.vision"></a>
180+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
181+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
182+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
183+
</div>
184+
<br/>
185+
<p align="center">
186+
&emsp;&emsp;<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>
187+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
188+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
189+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
190+
&nbsp;&nbsp;&nbsp;&nbsp;<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>
191+
</p>

0 commit comments

Comments
 (0)