@regulaforensics/face-sdk 7.2.433-rc → 7.2.444-rc

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.
Files changed (173) hide show
  1. package/README.md +2 -3
  2. package/RNFaceSDK.podspec +2 -2
  3. package/android/build.gradle +1 -1
  4. package/android/cordova.gradle +1 -1
  5. package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +2 -0
  6. package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +18 -0
  7. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +2 -2
  8. package/examples/capacitor/index.html +2 -7
  9. package/examples/capacitor/index.tsx +53 -0
  10. package/examples/capacitor/package-lock.json +12 -162
  11. package/examples/capacitor/package.json +4 -4
  12. package/examples/capacitor/scripts/setup.sh +4 -2
  13. package/examples/capacitor/src/main.css +60 -6
  14. package/examples/capacitor/src/main.html +1 -1
  15. package/examples/capacitor/src/main.tsx +51 -87
  16. package/examples/ionic/README.md +1 -1
  17. package/examples/ionic/angular.json +3 -3
  18. package/examples/ionic/config.xml +4 -2
  19. package/examples/ionic/index.tsx +68 -0
  20. package/examples/ionic/package-lock.json +42 -68
  21. package/examples/ionic/package.json +2 -2
  22. package/examples/ionic/src/main.css +60 -6
  23. package/examples/ionic/src/main.html +1 -1
  24. package/examples/ionic/src/{main.ts → main.tsx} +52 -97
  25. package/examples/ionic/tsconfig.json +3 -2
  26. package/examples/react_native/README.md +1 -0
  27. package/examples/react_native/app.config.ts +1 -1
  28. package/examples/react_native/index.tsx +49 -7
  29. package/examples/react_native/package-lock.json +594 -597
  30. package/examples/react_native/package.json +9 -9
  31. package/examples/react_native/src/main.css +60 -6
  32. package/examples/react_native/src/main.html +1 -1
  33. package/examples/react_native/src/main.tsx +54 -77
  34. package/ios/RFSWJSONConstructor.h +0 -1
  35. package/ios/RFSWJSONConstructor.m +5 -14
  36. package/ios/RFSWMain.m +30 -0
  37. package/package.json +1 -1
  38. package/plugin.xml +2 -2
  39. package/test/json.tsx +375 -0
  40. package/test/package-lock.json +584 -0
  41. package/test/package.json +9 -0
  42. package/test/test.tsx +61 -0
  43. package/test/utils.tsx +38 -0
  44. package/www/capacitor/customization/customization_fonts.js +1 -1
  45. package/www/capacitor/customization/customization_images.js +1 -1
  46. package/www/capacitor/customization/font.js +8 -0
  47. package/www/capacitor/detect_faces/detect_face_result.js +12 -0
  48. package/www/capacitor/detect_faces/detect_faces_attribute_result.js +9 -0
  49. package/www/capacitor/detect_faces/detect_faces_backend_exception.js +7 -0
  50. package/www/capacitor/detect_faces/detect_faces_config.js +34 -0
  51. package/www/capacitor/detect_faces/detect_faces_exception.js +8 -0
  52. package/www/capacitor/detect_faces/detect_faces_request.js +22 -0
  53. package/www/capacitor/detect_faces/detect_faces_response.js +9 -0
  54. package/www/capacitor/face_capture/face_capture_config.js +37 -0
  55. package/www/capacitor/face_capture/face_capture_exception.js +7 -0
  56. package/www/capacitor/face_capture/face_capture_image.js +8 -0
  57. package/www/capacitor/face_capture/face_capture_response.js +7 -0
  58. package/www/capacitor/image_params/output_image_crop.js +23 -0
  59. package/www/capacitor/image_params/output_image_params.js +19 -0
  60. package/www/capacitor/image_params/point.js +7 -0
  61. package/www/capacitor/image_params/rect.js +9 -0
  62. package/www/capacitor/image_params/size.js +12 -0
  63. package/www/capacitor/image_quality/image_quality_characteristic.js +22 -0
  64. package/www/capacitor/image_quality/image_quality_range.js +7 -0
  65. package/www/capacitor/image_quality/image_quality_result.js +10 -0
  66. package/www/capacitor/index.js +48 -0
  67. package/www/capacitor/init/face_sdk_version.js +8 -0
  68. package/www/capacitor/init/init_config.js +19 -0
  69. package/www/capacitor/init/init_exception.js +8 -0
  70. package/www/capacitor/init/license_exception.js +7 -0
  71. package/www/capacitor/internal/bridge.js +20 -1
  72. package/www/capacitor/liveness/liveness_backend_exception.js +7 -0
  73. package/www/capacitor/liveness/liveness_config.js +43 -0
  74. package/www/capacitor/liveness/liveness_exception.js +8 -0
  75. package/www/capacitor/liveness/liveness_notification.js +7 -0
  76. package/www/capacitor/liveness/liveness_response.js +11 -0
  77. package/www/capacitor/match_faces/compared_face.js +9 -0
  78. package/www/capacitor/match_faces/compared_faces_pair.js +10 -0
  79. package/www/capacitor/match_faces/compared_faces_split.js +7 -0
  80. package/www/capacitor/match_faces/match_faces_backend_exception.js +7 -0
  81. package/www/capacitor/match_faces/match_faces_config.js +19 -0
  82. package/www/capacitor/match_faces/match_faces_detection.js +9 -0
  83. package/www/capacitor/match_faces/match_faces_detection_face.js +11 -0
  84. package/www/capacitor/match_faces/match_faces_exception.js +8 -0
  85. package/www/capacitor/match_faces/match_faces_image.js +9 -0
  86. package/www/capacitor/match_faces/match_faces_request.js +27 -0
  87. package/www/capacitor/match_faces/match_faces_response.js +9 -0
  88. package/www/capacitor/person_database/edit_group_persons_request.js +15 -0
  89. package/www/capacitor/person_database/image_upload.js +17 -0
  90. package/www/capacitor/person_database/pageable_item_list.js +8 -0
  91. package/www/capacitor/person_database/person.js +13 -0
  92. package/www/capacitor/person_database/person_group.js +11 -0
  93. package/www/capacitor/person_database/person_image.js +13 -0
  94. package/www/capacitor/person_database/search_person.js +14 -0
  95. package/www/capacitor/person_database/search_person_detection.js +9 -0
  96. package/www/capacitor/person_database/search_person_image.js +15 -0
  97. package/www/capacitor/person_database/search_person_request.js +29 -0
  98. package/www/cordova.js +753 -6
  99. package/www/react-native/customization/customization_fonts.js +1 -1
  100. package/www/react-native/customization/customization_images.js +1 -1
  101. package/www/react-native/customization/font.js +8 -0
  102. package/www/react-native/detect_faces/detect_face_result.js +12 -0
  103. package/www/react-native/detect_faces/detect_faces_attribute_result.js +9 -0
  104. package/www/react-native/detect_faces/detect_faces_backend_exception.js +7 -0
  105. package/www/react-native/detect_faces/detect_faces_config.js +34 -0
  106. package/www/react-native/detect_faces/detect_faces_exception.js +8 -0
  107. package/www/react-native/detect_faces/detect_faces_request.js +22 -0
  108. package/www/react-native/detect_faces/detect_faces_response.js +9 -0
  109. package/www/react-native/face_capture/face_capture_config.js +37 -0
  110. package/www/react-native/face_capture/face_capture_exception.js +7 -0
  111. package/www/react-native/face_capture/face_capture_image.js +8 -0
  112. package/www/react-native/face_capture/face_capture_response.js +7 -0
  113. package/www/react-native/image_params/output_image_crop.js +23 -0
  114. package/www/react-native/image_params/output_image_params.js +19 -0
  115. package/www/react-native/image_params/point.js +7 -0
  116. package/www/react-native/image_params/rect.js +9 -0
  117. package/www/react-native/image_params/size.js +12 -0
  118. package/www/react-native/image_quality/image_quality_characteristic.js +22 -0
  119. package/www/react-native/image_quality/image_quality_range.js +7 -0
  120. package/www/react-native/image_quality/image_quality_result.js +10 -0
  121. package/www/react-native/index.js +48 -0
  122. package/www/react-native/init/face_sdk_version.js +8 -0
  123. package/www/react-native/init/init_config.js +19 -0
  124. package/www/react-native/init/init_exception.js +8 -0
  125. package/www/react-native/init/license_exception.js +7 -0
  126. package/www/react-native/internal/bridge.js +20 -1
  127. package/www/react-native/liveness/liveness_backend_exception.js +7 -0
  128. package/www/react-native/liveness/liveness_config.js +43 -0
  129. package/www/react-native/liveness/liveness_exception.js +8 -0
  130. package/www/react-native/liveness/liveness_notification.js +7 -0
  131. package/www/react-native/liveness/liveness_response.js +11 -0
  132. package/www/react-native/match_faces/compared_face.js +9 -0
  133. package/www/react-native/match_faces/compared_faces_pair.js +10 -0
  134. package/www/react-native/match_faces/compared_faces_split.js +7 -0
  135. package/www/react-native/match_faces/match_faces_backend_exception.js +7 -0
  136. package/www/react-native/match_faces/match_faces_config.js +19 -0
  137. package/www/react-native/match_faces/match_faces_detection.js +9 -0
  138. package/www/react-native/match_faces/match_faces_detection_face.js +11 -0
  139. package/www/react-native/match_faces/match_faces_exception.js +8 -0
  140. package/www/react-native/match_faces/match_faces_image.js +9 -0
  141. package/www/react-native/match_faces/match_faces_request.js +27 -0
  142. package/www/react-native/match_faces/match_faces_response.js +9 -0
  143. package/www/react-native/person_database/edit_group_persons_request.js +15 -0
  144. package/www/react-native/person_database/image_upload.js +17 -0
  145. package/www/react-native/person_database/pageable_item_list.js +8 -0
  146. package/www/react-native/person_database/person.js +13 -0
  147. package/www/react-native/person_database/person_group.js +11 -0
  148. package/www/react-native/person_database/person_image.js +13 -0
  149. package/www/react-native/person_database/search_person.js +14 -0
  150. package/www/react-native/person_database/search_person_detection.js +9 -0
  151. package/www/react-native/person_database/search_person_image.js +15 -0
  152. package/www/react-native/person_database/search_person_request.js +29 -0
  153. package/www/types/index.d.ts +12 -0
  154. package/www/types/match_faces/match_faces_config.d.ts +2 -0
  155. package/www/types/person_database/search_person_request.d.ts +4 -0
  156. package/examples/cordova/.vscode/launch.json +0 -28
  157. package/examples/cordova/README.md +0 -25
  158. package/examples/cordova/config.xml +0 -26
  159. package/examples/cordova/package-lock.json +0 -1327
  160. package/examples/cordova/package.json +0 -30
  161. package/examples/cordova/scripts/android.sh +0 -8
  162. package/examples/cordova/scripts/ios.sh +0 -8
  163. package/examples/cordova/scripts/setup.sh +0 -8
  164. package/examples/cordova/www/images/logo.png +0 -0
  165. package/examples/cordova/www/index.html +0 -21
  166. package/examples/cordova/www/src/main.css +0 -83
  167. package/examples/cordova/www/src/main.html +0 -25
  168. package/examples/cordova/www/src/main.js +0 -152
  169. package/examples/ionic/index.ts +0 -17
  170. package/examples/ionic/src/images/portrait.png +0 -0
  171. /package/examples/ionic/{src/assets → assets}/.gitkeep +0 -0
  172. /package/examples/ionic/{src/images → images}/icon.png +0 -0
  173. /package/examples/{cordova/www → ionic}/images/portrait.png +0 -0
@@ -1,30 +0,0 @@
1
- {
2
- "name": "face-sdk",
3
- "scripts": {
4
- "setup": "scripts/setup.sh",
5
- "ios": "scripts/ios.sh",
6
- "android": "scripts/android.sh"
7
- },
8
- "dependencies": {
9
- "@regulaforensics/face-sdk": "7.2.433-rc",
10
- "@regulaforensics/face-core-basic": "7.2.250-rc",
11
- "cordova-ios": "7.1.1",
12
- "cordova-android": "13.0.0",
13
- "cordova-plugin-file": "8.1.3",
14
- "cordova-plugin-camera": "8.0.0",
15
- "cordova-plugin-dialogs": "2.0.2"
16
- },
17
- "cordova": {
18
- "plugins": {
19
- "@regulaforensics/face-sdk": {},
20
- "@regulaforensics/face-core-basic": {},
21
- "cordova-plugin-file": {},
22
- "cordova-plugin-camera": {},
23
- "cordova-plugin-dialogs": {}
24
- },
25
- "platforms": [
26
- "android",
27
- "ios"
28
- ]
29
- }
30
- }
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- if [[ $npm_config_o || $npm_config_open ]]; then
4
- cordova prepare android
5
- studio platforms/android || open -a 'Android Studio' platforms/android
6
- else
7
- cordova run android
8
- fi
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- if [[ $npm_config_o || $npm_config_open ]]; then
4
- cordova prepare ios
5
- open platforms/ios/FaceSDK.xcworkspace
6
- else
7
- cordova run ios
8
- fi
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- npm install
5
- cordova prepare || {
6
- pod repo update
7
- cordova prepare
8
- }
@@ -1,21 +0,0 @@
1
- <meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
2
- <link rel="stylesheet" href="src/main.css">
3
- <script src="cordova.js"></script>
4
- <script src="src/main.js"></script>
5
-
6
- <div id="content" style="height: 100%"></div>
7
-
8
- <script>
9
- document.addEventListener('deviceready', () => {
10
- window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + 'www/src/main.html', (fileEntry) => {
11
- fileEntry.file((file) => {
12
- const reader = new FileReader()
13
- reader.onloadend = function () {
14
- document.getElementById('content').innerHTML = this.result
15
- document.dispatchEvent(new CustomEvent("ready"))
16
- }
17
- reader.readAsText(file)
18
- })
19
- })
20
- })
21
- </script>
@@ -1,83 +0,0 @@
1
- html,
2
- body {
3
- width: 99%;
4
- height: 99vh;
5
- display: flex;
6
- flex-direction: column;
7
- }
8
-
9
- .page {
10
- height: 100%;
11
- display: flex;
12
- flex-direction: column;
13
- }
14
-
15
- .column {
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- justify-content: center;
20
- width: 100%;
21
- }
22
-
23
- .row {
24
- display: flex;
25
- flex-direction: row;
26
- align-items: center;
27
- justify-content: center;
28
- }
29
-
30
- .header {
31
- text-align: center;
32
- padding-top: 80px;
33
- margin-top: -10px;
34
- background-color: rgba(0, 0, 0, 0.03);
35
- font-weight: 600;
36
- font-size: 18px;
37
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
38
- }
39
-
40
- .sub-header {
41
- background-color: rgba(0, 0, 0, 0.03);
42
- width: 100%;
43
- padding-top: 13px;
44
- text-align: center;
45
- font-weight: 550;
46
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
47
- }
48
-
49
- .divider {
50
- height: 1px;
51
- background-color: rgba(0, 0, 0, 0.075);
52
- margin-top: 13px;
53
- }
54
-
55
- .no-scroll {
56
- flex-grow: 1;
57
- overflow-y: hidden;
58
- overflow-x: hidden;
59
- }
60
-
61
- .button {
62
- width: 175px;
63
- height: 40px;
64
- margin: 5px;
65
- margin-top: 10px;
66
- background-color: #4285F4;
67
- color: white;
68
- border: none;
69
- padding: 10px 20px;
70
- font-size: 16px;
71
- border-radius: 100px;
72
- cursor: pointer;
73
- transition: all 0.3s ease;
74
- user-select: none;
75
- -webkit-user-select: none;
76
- -moz-user-select: none;
77
- -ms-user-select: none;
78
- }
79
-
80
- .button:active {
81
- position: relative;
82
- top: 1px;
83
- }
@@ -1,25 +0,0 @@
1
- <div class="page">
2
- <div class="column header">
3
- <span id="status">Loading...</span>
4
- <div class="column divider"></div>
5
- </div>
6
- <div class="column sub-header">
7
- <div class="row" style="width: 100%">
8
- <div style="width: 185px">Similarity: <span id="similarity-status">null</span></div>
9
- <div style="width: 185px">Liveness: <span id="liveness-status">null</span></div>
10
- </div>
11
- <div class="column divider"></div>
12
- </div>
13
- <div class="column no-scroll">
14
- <div class="row" style="height: 100%">
15
- <img id="first-image" src="images/portrait.png" width="175px" style="padding: 5px">
16
- <img id="second-image" src="images/portrait.png" width="175px" style="padding: 5px">
17
- </div>
18
- <div class="row">
19
- <button id="match-faces" class="button">Match</button>
20
- <button id="start-liveness" class="button">Liveness</button>
21
- </div>
22
- <button id="clear-results" class="button" style="width: 360px">Clear</button>
23
- <div style="padding-top: 30px"></div>
24
- </div>
25
- </div>
@@ -1,152 +0,0 @@
1
- document.addEventListener('ready', onDeviceReady)
2
- async function onDeviceReady() {
3
- faceSdk = FaceSDKPlugin.FaceSDK.instance
4
-
5
- image1 = null
6
- image2 = null
7
-
8
- // imports
9
- FaceCaptureResponse = FaceSDKPlugin.FaceCaptureResponse
10
- LivenessResponse = FaceSDKPlugin.LivenessResponse
11
- MatchFacesResponse = FaceSDKPlugin.MatchFacesResponse
12
- MatchFacesRequest = FaceSDKPlugin.MatchFacesRequest
13
- MatchFacesImage = FaceSDKPlugin.MatchFacesImage
14
- ComparedFacesSplit = FaceSDKPlugin.ComparedFacesSplit
15
- InitConfig = FaceSDKPlugin.InitConfig
16
- InitResponse = FaceSDKPlugin.InitResponse
17
- LivenessNotification = FaceSDKPlugin.LivenessNotification
18
- ImageType = FaceSDKPlugin.ImageType
19
- LivenessSkipStep = FaceSDKPlugin.LivenessSkipStep
20
- LivenessStatus = FaceSDKPlugin.LivenessStatus
21
- LivenessConfig = FaceSDKPlugin.LivenessConfig
22
-
23
- setStatus = data => document.getElementById("status").innerHTML = data
24
- setLivenessStatus = data => document.getElementById("liveness-status").innerHTML = data
25
- setSimilarityStatus = data => document.getElementById("similarity-status").innerHTML = data
26
- setUiImage1 = data => document.getElementById("first-image").src = data
27
- setUiImage2 = data => document.getElementById("second-image").src = data
28
- resetImages = () => {
29
- setUiImage1("images/portrait.png")
30
- setUiImage2("images/portrait.png")
31
- }
32
- document.getElementById("first-image").onclick = () => pickImage(1)
33
- document.getElementById("second-image").onclick = () => pickImage(2)
34
- document.getElementById("match-faces").onclick = () => matchFaces()
35
- document.getElementById("start-liveness").onclick = () => startLiveness()
36
- document.getElementById("clear-results").onclick = () => clearResults()
37
-
38
- init()
39
- }
40
-
41
- async function init() {
42
- if (!await initialize()) return
43
- setStatus("Ready")
44
- }
45
-
46
- async function startLiveness() {
47
- var response = await faceSdk.startLiveness({
48
- config: new LivenessConfig({
49
- skipStep: [LivenessSkipStep.ONBOARDING_STEP]
50
- }),
51
- notificationCompletion: (notification) => {
52
- console.log("LivenessStatus: " + notification.status)
53
- }
54
- })
55
- if (response.image == null) return
56
- setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
57
- setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
58
- }
59
-
60
- async function matchFaces() {
61
- if (image1 == null || image2 == null) {
62
- setStatus("Both images required!")
63
- return
64
- }
65
- setStatus("Processing...")
66
- var request = new MatchFacesRequest([image1, image2])
67
- var response = await faceSdk.matchFaces(request)
68
- var split = await faceSdk.splitComparedFaces(response.results, 0.75)
69
- var match = split.matchedFaces
70
- setSimilarityStatus("failed")
71
- if (match.length > 0)
72
- setSimilarityStatus((match[0].similarity * 100).toFixed(2) + "%")
73
- setStatus("Ready")
74
- }
75
-
76
- function clearResults() {
77
- setStatus("Ready")
78
- setSimilarityStatus("null")
79
- setLivenessStatus("null")
80
- resetImages()
81
- image1 = null
82
- image2 = null
83
- }
84
-
85
- // If 'regula.license' exists, init using license(enables offline match)
86
- // otherwise init without license.
87
- async function initialize() {
88
- setStatus("Initializing...")
89
-
90
- var license = await loadAssetIfExists("regula.license")
91
- var config
92
- if (license != null) config = new InitConfig(license)
93
- var [success, error] = await faceSdk.initialize({ config: config })
94
-
95
- if (!success && error != null) {
96
- setStatus(error.message)
97
- console.log(error.code + ": " + error.message)
98
- }
99
- return success
100
- }
101
-
102
- function setImage(base64, type, position) {
103
- setSimilarityStatus("null")
104
- var mfImage = new MatchFacesImage(base64, type)
105
- if (position == 1) {
106
- image1 = mfImage
107
- setUiImage1(base64)
108
- setLivenessStatus("null")
109
- }
110
- if (position == 2) {
111
- image2 = mfImage
112
- setUiImage2(base64)
113
- }
114
- }
115
-
116
- async function useCamera(position) {
117
- var response = await faceSdk.startFaceCapture()
118
- if (response.image == null) return
119
- var image = response.image
120
- setImage("data:image/png;base64," + image.image, image.imageType, position)
121
- }
122
-
123
- function useGallery(position) {
124
- navigator.camera.getPicture(function (result) {
125
- if (result == null) return
126
- setImage(result, ImageType.PRINTED, position)
127
- }, function (_) { }, {
128
- destinationType: Camera.DestinationType.DATA_URL,
129
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
130
- mediaType: Camera.MediaType.PICTURE
131
- })
132
- }
133
-
134
- function pickImage(position) {
135
- navigator.notification.confirm("", button => {
136
- if (button == 1) useGallery(position)
137
- else useCamera(position)
138
- }, "Select option", ["Use gallery", "Use camera"])
139
- }
140
-
141
- async function loadAssetIfExists(path) {
142
- path = cordova.file.applicationDirectory + "www/" + path
143
- return new Promise((resolve, _) => {
144
- window.resolveLocalFileSystemURL(path, (fileEntry) => {
145
- fileEntry.file((file) => {
146
- var reader = new FileReader()
147
- reader.onloadend = function (_) { resolve(this.result) }
148
- reader.readAsDataURL(file)
149
- })
150
- }, (_) => resolve(null))
151
- })
152
- }
@@ -1,17 +0,0 @@
1
- import 'zone.js';
2
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
3
- import { BrowserModule } from '@angular/platform-browser'
4
- import { IonicModule, Platform } from '@ionic/angular'
5
- import { Dialogs } from '@awesome-cordova-plugins/dialogs/ngx'
6
- import { Camera } from '@awesome-cordova-plugins/camera/ngx'
7
- import { Main } from './src/main'
8
- import { NgModule } from '@angular/core'
9
-
10
- @NgModule({
11
- bootstrap: [Main],
12
- providers: [Platform, Dialogs, Camera],
13
- imports: [BrowserModule, IonicModule.forRoot()]
14
- })
15
- class MainModule { }
16
-
17
- platformBrowserDynamic().bootstrapModule(MainModule)
File without changes
File without changes