@getyoti/react-face-capture 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +79 -11
- package/index.js +1 -1
- package/package.json +4 -6
- package/vanilla/assets/face-capture/tiny_face_detector_model-shard1 +0 -0
- package/vanilla/assets/face-capture/tiny_face_detector_model-weights_manifest.json +197 -0
- package/vanilla/index.css +1 -0
- package/vanilla/index.js +3 -0
- package/vanilla/index.js.LICENSE.txt +34 -0
- package/vanilla/index.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v0.5.0
|
|
4
|
+
|
|
5
|
+
### New features
|
|
6
|
+
|
|
7
|
+
- Implemented localisation languages
|
|
8
|
+
- `et`: Estonian
|
|
9
|
+
- `id`: Bahasa
|
|
10
|
+
- `ko`: Korean
|
|
11
|
+
- `lt`: Lithuanian
|
|
12
|
+
- `ms`: Malay
|
|
13
|
+
- `uk`: Ukranian
|
|
14
|
+
|
|
15
|
+
## v0.4.0
|
|
16
|
+
|
|
17
|
+
### New features
|
|
18
|
+
|
|
19
|
+
- Implemented Face capture module vanilla, to run our module without react stack application
|
|
20
|
+
- Implemented brightness validation to stop images too dark or too bright
|
|
21
|
+
- Implemented localisation languages
|
|
22
|
+
- `cs`: Czech
|
|
23
|
+
- `da`: Danish
|
|
24
|
+
- `de`: German
|
|
25
|
+
- `fi`: Finnish
|
|
26
|
+
- `hi`: Hindi
|
|
27
|
+
- `it`: Italian
|
|
28
|
+
- `ja`: Japanese
|
|
29
|
+
- `nb`: Norwegian
|
|
30
|
+
- `nl`: Dutch
|
|
31
|
+
- `pl`: Polish
|
|
32
|
+
- `pt`: Portuguese
|
|
33
|
+
- `ro`: Romanian
|
|
34
|
+
- `ru`: Russian
|
|
35
|
+
- `sv`: Swedish
|
|
36
|
+
- `th`: Thai
|
|
37
|
+
- `tr`: Turkish
|
|
38
|
+
- `vi`: Vietnamese
|
|
39
|
+
|
|
40
|
+
## v0.3.1
|
|
41
|
+
|
|
42
|
+
### New features
|
|
43
|
+
|
|
44
|
+
- Image payload optimisation on Horizontal images by removing unused image edges.
|
|
45
|
+
|
|
46
|
+
## v0.3.0
|
|
47
|
+
|
|
48
|
+
### New features
|
|
49
|
+
|
|
50
|
+
- Export error codes and component properties values constants
|
|
51
|
+
|
|
52
|
+
### Fixes
|
|
53
|
+
|
|
54
|
+
- Fix feedback message when the user is too close to the camera
|
|
55
|
+
|
|
56
|
+
- Fix state warning after component mounting
|
|
57
|
+
|
|
3
58
|
## v0.2.0
|
|
4
59
|
|
|
5
60
|
### New features
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Yoti Face capture integration
|
|
2
2
|
|
|
3
3
|
The purpose of this module is to capture a face and return the output image.
|
|
4
4
|
|
|
@@ -17,14 +17,14 @@ The package depends on the following peer dependencies
|
|
|
17
17
|
|
|
18
18
|
<browserSupportTable>
|
|
19
19
|
|
|
20
|
-
| Browser | Versions
|
|
21
|
-
| ------- |
|
|
22
|
-
| and_chr |
|
|
23
|
-
| chrome |
|
|
24
|
-
| edge |
|
|
25
|
-
| firefox |
|
|
26
|
-
| ios_saf | 14
|
|
27
|
-
| safari |
|
|
20
|
+
| Browser | Versions |
|
|
21
|
+
| ------- | ----------------------------- |
|
|
22
|
+
| and_chr | 96 |
|
|
23
|
+
| chrome | 96,95,94,93 |
|
|
24
|
+
| edge | 96,95 |
|
|
25
|
+
| firefox | 95,94,93,92 |
|
|
26
|
+
| ios_saf | 15.0-15.1,14.5-14.8,14.0-14.4 |
|
|
27
|
+
| safari | 15.1,15,14.1,14 |
|
|
28
28
|
|
|
29
29
|
</browserSupportTable>
|
|
30
30
|
|
|
@@ -84,11 +84,32 @@ new CopyPlugin([
|
|
|
84
84
|
Current languages supported:
|
|
85
85
|
|
|
86
86
|
- `en`: English
|
|
87
|
+
- `cs`: Czech
|
|
88
|
+
- `da`: Danish
|
|
89
|
+
- `de`: German
|
|
87
90
|
- `es`: Spanish (Spain)
|
|
88
91
|
- `es-419`: Spanish (Latin America)
|
|
89
|
-
- `
|
|
90
|
-
- `
|
|
92
|
+
- `et`: Estonian
|
|
93
|
+
- `fi`: Finnish
|
|
91
94
|
- `fr`: French
|
|
95
|
+
- `hi`: Hindi
|
|
96
|
+
- `id`: Bahasa
|
|
97
|
+
- `it`: Italian
|
|
98
|
+
- `ja`: Japanese
|
|
99
|
+
- `ko`: Korean
|
|
100
|
+
- `lt`: Lithuanian
|
|
101
|
+
- `ms`: Malay
|
|
102
|
+
- `nb`: Norwegian
|
|
103
|
+
- `nl`: Dutch
|
|
104
|
+
- `pl`: Polish
|
|
105
|
+
- `pt`: Portuguese
|
|
106
|
+
- `ro`: Romanian
|
|
107
|
+
- `ru`: Russian
|
|
108
|
+
- `sv`: Swedish
|
|
109
|
+
- `th`: Thai
|
|
110
|
+
- `tr`: Turkish
|
|
111
|
+
- `uk`: Ukranian
|
|
112
|
+
- `vi`: Vietnamese
|
|
92
113
|
|
|
93
114
|
### Language fallback
|
|
94
115
|
|
|
@@ -110,6 +131,12 @@ Mechanisnm used for the prop `language` to avoid issues when the value passed is
|
|
|
110
131
|
| `FACE_DETECTION_INIT_ERROR` | The face detection has failed to initialise. This usually means that the required model assets are missing from the host application. |
|
|
111
132
|
| `INTERNAL_ERROR` | Internal error. This can be due to a programming error, or the user using an old unsupported browser. |
|
|
112
133
|
|
|
134
|
+
The error codes can be imported as follow:
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
import { ERROR_CODE } from '@getyoti/react-face-capture';
|
|
138
|
+
```
|
|
139
|
+
|
|
113
140
|
## Example
|
|
114
141
|
|
|
115
142
|
```js
|
|
@@ -123,3 +150,44 @@ export function App() {
|
|
|
123
150
|
return <FaceCapture onSuccess={onSuccess} onError={onError} />;
|
|
124
151
|
}
|
|
125
152
|
```
|
|
153
|
+
|
|
154
|
+
## Face capture module vanilla
|
|
155
|
+
|
|
156
|
+
If you do not have a react tech stack, you can use the face capture vanilla version.
|
|
157
|
+
When you install the library on your machine, It's located inside the folder `vanilla`.
|
|
158
|
+
|
|
159
|
+
Add the package in your codebase and serve the static assets:
|
|
160
|
+
|
|
161
|
+
### 1. serve package static assets
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
|
|
165
|
+
/@getyoti/react-face-capture/vanilla/assets/face-capture/
|
|
166
|
+
/@getyoti/react-face-capture/vanilla/index.css
|
|
167
|
+
/@getyoti/react-face-capture/vanilla/index.js
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 2. Add Face capture script and style
|
|
171
|
+
|
|
172
|
+
Inside the page you want to have face capture, add Face capture scripts and style like in the example below.
|
|
173
|
+
`faceCaptureAssetsRootUrl` is property you can use to instruct the library where neural net files are served otherwise we look the files relative to the page location `assets/face-capture/`.
|
|
174
|
+
|
|
175
|
+
### 3. Render face capture
|
|
176
|
+
|
|
177
|
+
Our scripts will give you access to `Yoti.FaceCaptureModule.render` you can pass 2 parameters, first parameters are the props and are the same used in react integration and second parameter you need a html DOM reference so we know where we can render the UI.
|
|
178
|
+
|
|
179
|
+
**index.html**
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<link href="/@getyoti/react-face-capture/vanilla/index.css" />
|
|
183
|
+
<script src="/@getyoti/react-face-capture/vanilla/index.js" />
|
|
184
|
+
<script>
|
|
185
|
+
const props = {
|
|
186
|
+
faceCaptureAssetsRootUrl: '/@getyoti/react-face-capture/vanilla/assets/';
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
Yoti.FaceCaptureModule.render(props, document.getElementById('face-capture-module-root'));
|
|
190
|
+
</script>
|
|
191
|
+
|
|
192
|
+
<div id="face-capture-module-root"></div>
|
|
193
|
+
```
|