@regulaforensics/face-sdk 6.5.67-beta → 6.5.84-beta
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/RNFaceSDK.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/examples/capacitor/README.md +4 -4
- package/examples/capacitor/package.json +5 -5
- package/examples/capacitor/scripts/android.sh +9 -0
- package/examples/capacitor/scripts/ios.sh +8 -0
- package/examples/capacitor/scripts/setup.sh +4 -0
- package/examples/cordova/README.md +4 -4
- package/examples/cordova/package.json +6 -11
- package/examples/cordova/scripts/android.sh +8 -0
- package/examples/cordova/scripts/ios.sh +8 -0
- package/examples/cordova/scripts/setup.sh +5 -0
- package/examples/ionic/README.md +4 -4
- package/examples/ionic/package.json +5 -5
- package/examples/ionic/scripts/android.sh +8 -0
- package/examples/ionic/scripts/ios.sh +8 -0
- package/examples/ionic/scripts/setup.sh +5 -0
- package/examples/ionic/src/app/home/home.page.ts +56 -5
- package/examples/react-native/README.md +4 -4
- package/examples/react-native/ios/Podfile.lock +319 -303
- package/examples/react-native/package.json +5 -6
- package/examples/react-native/scripts/android.sh +8 -0
- package/examples/react-native/scripts/ios.sh +8 -0
- package/examples/react-native/scripts/setup.sh +8 -0
- package/package.json +2 -1
- package/plugin.xml +2 -2
- package/www/capacitor/customization/customization.js +66 -0
- package/www/capacitor/customization/customization_colors.js +233 -0
- package/www/capacitor/customization/customization_fonts.js +106 -0
- package/www/capacitor/customization/customization_images.js +129 -0
- package/www/capacitor/customization/font.js +29 -0
- package/www/capacitor/detect_faces/detect_face_result.js +38 -0
- package/www/capacitor/detect_faces/detect_faces_attribute.js +15 -0
- package/www/capacitor/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/capacitor/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/capacitor/detect_faces/detect_faces_config.js +14 -0
- package/www/capacitor/detect_faces/detect_faces_exception.js +30 -0
- package/www/capacitor/detect_faces/detect_faces_request.js +67 -0
- package/www/capacitor/detect_faces/detect_faces_response.js +24 -0
- package/www/capacitor/detect_faces/detect_faces_scenario.js +10 -0
- package/www/capacitor/face_capture/face_capture_config.js +28 -0
- package/www/capacitor/face_capture/face_capture_exception.js +25 -0
- package/www/capacitor/face_capture/face_capture_image.js +26 -0
- package/www/capacitor/face_capture/face_capture_response.js +17 -0
- package/www/capacitor/image_params/output_image_crop.js +21 -0
- package/www/capacitor/image_params/output_image_params.js +9 -0
- package/www/capacitor/image_params/point.js +14 -0
- package/www/capacitor/image_params/rect.js +18 -0
- package/www/capacitor/image_params/size.js +9 -0
- package/www/capacitor/image_quality/image_quality_characteristic.js +24 -0
- package/www/capacitor/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/capacitor/image_quality/image_quality_group.js +332 -0
- package/www/capacitor/image_quality/image_quality_range.js +26 -0
- package/www/capacitor/image_quality/image_quality_result.js +40 -0
- package/www/capacitor/index.js +179 -4
- package/www/capacitor/init/face_sdk_version.js +16 -0
- package/www/capacitor/match_faces/compared_face.js +21 -0
- package/www/capacitor/match_faces/compared_faces_pair.js +23 -0
- package/www/capacitor/match_faces/compared_faces_split.js +22 -0
- package/www/capacitor/match_faces/match_faces_backend_exception.js +14 -0
- package/www/capacitor/match_faces/match_faces_config.js +12 -0
- package/www/capacitor/match_faces/match_faces_detection.js +25 -0
- package/www/capacitor/match_faces/match_faces_detection_face.js +28 -0
- package/www/capacitor/match_faces/match_faces_exception.js +30 -0
- package/www/capacitor/match_faces/match_faces_image.js +25 -0
- package/www/capacitor/match_faces/match_faces_request.js +13 -0
- package/www/capacitor/match_faces/match_faces_response.js +28 -0
- package/www/capacitor/person_database/edit_group_persons_request.js +9 -0
- package/www/capacitor/person_database/image_upload.js +16 -0
- package/www/capacitor/person_database/pageable_item_list.js +22 -0
- package/www/capacitor/person_database/person.js +22 -0
- package/www/capacitor/person_database/person_database.js +145 -0
- package/www/capacitor/person_database/person_group.js +18 -0
- package/www/capacitor/person_database/person_image.js +22 -0
- package/www/capacitor/person_database/search_person.js +31 -0
- package/www/capacitor/person_database/search_person_detection.js +22 -0
- package/www/capacitor/person_database/search_person_image.js +26 -0
- package/www/capacitor/person_database/search_person_request.js +17 -0
- package/www/cordova.js +3478 -385
- package/www/react-native/customization/customization.js +66 -0
- package/www/react-native/customization/customization_colors.js +233 -0
- package/www/react-native/customization/customization_fonts.js +106 -0
- package/www/react-native/customization/customization_images.js +129 -0
- package/www/react-native/customization/font.js +29 -0
- package/www/react-native/detect_faces/detect_face_result.js +38 -0
- package/www/react-native/detect_faces/detect_faces_attribute.js +15 -0
- package/www/react-native/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/react-native/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/react-native/detect_faces/detect_faces_config.js +14 -0
- package/www/react-native/detect_faces/detect_faces_exception.js +30 -0
- package/www/react-native/detect_faces/detect_faces_request.js +67 -0
- package/www/react-native/detect_faces/detect_faces_response.js +24 -0
- package/www/react-native/detect_faces/detect_faces_scenario.js +10 -0
- package/www/react-native/face_capture/face_capture_config.js +28 -0
- package/www/react-native/face_capture/face_capture_exception.js +25 -0
- package/www/react-native/face_capture/face_capture_image.js +26 -0
- package/www/react-native/face_capture/face_capture_response.js +17 -0
- package/www/react-native/image_params/output_image_crop.js +21 -0
- package/www/react-native/image_params/output_image_params.js +9 -0
- package/www/react-native/image_params/point.js +14 -0
- package/www/react-native/image_params/rect.js +18 -0
- package/www/react-native/image_params/size.js +9 -0
- package/www/react-native/image_quality/image_quality_characteristic.js +24 -0
- package/www/react-native/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/react-native/image_quality/image_quality_group.js +332 -0
- package/www/react-native/image_quality/image_quality_range.js +26 -0
- package/www/react-native/image_quality/image_quality_result.js +40 -0
- package/www/react-native/index.js +179 -4
- package/www/react-native/init/face_sdk_version.js +16 -0
- package/www/react-native/match_faces/compared_face.js +21 -0
- package/www/react-native/match_faces/compared_faces_pair.js +23 -0
- package/www/react-native/match_faces/compared_faces_split.js +22 -0
- package/www/react-native/match_faces/match_faces_backend_exception.js +14 -0
- package/www/react-native/match_faces/match_faces_config.js +12 -0
- package/www/react-native/match_faces/match_faces_detection.js +25 -0
- package/www/react-native/match_faces/match_faces_detection_face.js +28 -0
- package/www/react-native/match_faces/match_faces_exception.js +30 -0
- package/www/react-native/match_faces/match_faces_image.js +25 -0
- package/www/react-native/match_faces/match_faces_request.js +13 -0
- package/www/react-native/match_faces/match_faces_response.js +28 -0
- package/www/react-native/person_database/edit_group_persons_request.js +9 -0
- package/www/react-native/person_database/image_upload.js +16 -0
- package/www/react-native/person_database/pageable_item_list.js +22 -0
- package/www/react-native/person_database/person.js +22 -0
- package/www/react-native/person_database/person_database.js +145 -0
- package/www/react-native/person_database/person_group.js +18 -0
- package/www/react-native/person_database/person_image.js +22 -0
- package/www/react-native/person_database/search_person.js +31 -0
- package/www/react-native/person_database/search_person_detection.js +22 -0
- package/www/react-native/person_database/search_person_image.js +26 -0
- package/www/react-native/person_database/search_person_request.js +17 -0
- package/www/types/customization/customization.d.ts +46 -0
- package/www/types/customization/customization_colors.d.ts +37 -0
- package/www/types/customization/customization_fonts.d.ts +23 -0
- package/www/types/customization/customization_images.d.ts +24 -0
- package/www/types/customization/font.d.ts +41 -0
- package/www/types/detect_faces/detect_face_result.d.ts +16 -0
- package/www/types/detect_faces/detect_faces_attribute.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_attribute_result.d.ts +11 -0
- package/www/types/detect_faces/detect_faces_backend_exception.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_config.d.ts +37 -0
- package/www/types/detect_faces/detect_faces_exception.d.ts +24 -0
- package/www/types/detect_faces/detect_faces_request.d.ts +80 -0
- package/www/types/detect_faces/detect_faces_response.d.ts +12 -0
- package/www/types/detect_faces/detect_faces_scenario.d.ts +10 -0
- package/www/types/face_capture/face_capture_config.d.ts +39 -0
- package/www/types/face_capture/face_capture_exception.d.ts +17 -0
- package/www/types/face_capture/face_capture_image.d.ts +39 -0
- package/www/types/face_capture/face_capture_response.d.ts +9 -0
- package/www/types/image_params/output_image_crop.d.ts +49 -0
- package/www/types/image_params/output_image_params.d.ts +28 -0
- package/www/types/image_params/point.d.ts +9 -0
- package/www/types/image_params/rect.d.ts +8 -0
- package/www/types/image_params/size.d.ts +6 -0
- package/www/types/image_quality/image_quality_characteristic.d.ts +7 -0
- package/www/types/image_quality/image_quality_characteristic_name.d.ts +61 -0
- package/www/types/image_quality/image_quality_group.d.ts +418 -0
- package/www/types/image_quality/image_quality_range.d.ts +8 -0
- package/www/types/image_quality/image_quality_result.d.ts +30 -0
- package/www/types/index.d.ts +140 -4
- package/www/types/init/face_sdk_version.d.ts +16 -0
- package/www/types/match_faces/compared_face.d.ts +29 -0
- package/www/types/match_faces/compared_faces_pair.d.ts +36 -0
- package/www/types/match_faces/compared_faces_split.d.ts +8 -0
- package/www/types/match_faces/match_faces_backend_exception.d.ts +6 -0
- package/www/types/match_faces/match_faces_config.d.ts +14 -0
- package/www/types/match_faces/match_faces_detection.d.ts +30 -0
- package/www/types/match_faces/match_faces_detection_face.d.ts +43 -0
- package/www/types/match_faces/match_faces_exception.d.ts +21 -0
- package/www/types/match_faces/match_faces_image.d.ts +34 -0
- package/www/types/match_faces/match_faces_request.d.ts +34 -0
- package/www/types/match_faces/match_faces_response.d.ts +27 -0
- package/www/types/person_database/edit_group_persons_request.d.ts +8 -0
- package/www/types/person_database/image_upload.d.ts +20 -0
- package/www/types/person_database/pageable_item_list.d.ts +7 -0
- package/www/types/person_database/person.d.ts +33 -0
- package/www/types/person_database/person_database.d.ts +95 -0
- package/www/types/person_database/person_group.d.ts +22 -0
- package/www/types/person_database/person_image.d.ts +10 -0
- package/www/types/person_database/search_person.d.ts +31 -0
- package/www/types/person_database/search_person_detection.d.ts +11 -0
- package/www/types/person_database/search_person_image.d.ts +25 -0
- package/www/types/person_database/search_person_request.d.ts +39 -0
package/RNFaceSDK.podspec
CHANGED
|
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
|
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
7
|
s.name = 'RNFaceSDK'
|
|
8
|
-
s.version = '6.5.
|
|
8
|
+
s.version = '6.5.84-beta'
|
|
9
9
|
s.summary = package['description']
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
|
|
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.ios.deployment_target = '12.0'
|
|
17
17
|
s.source_files = 'ios/**/*.{h,m}'
|
|
18
18
|
s.exclude_files = [ 'ios/CVDFaceSDK.h', 'ios/CVDFaceSDK.m' ]
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'FaceSDKBeta', '6.2.1930'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -32,7 +32,7 @@ android {
|
|
|
32
32
|
rootProject.allprojects {
|
|
33
33
|
repositories {
|
|
34
34
|
maven {
|
|
35
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
35
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ dependencies {
|
|
|
41
41
|
//noinspection GradleDynamicVersion
|
|
42
42
|
implementation 'com.facebook.react:react-native:+'
|
|
43
43
|
//noinspection GradleDependency
|
|
44
|
-
implementation('com.regula.face:api:
|
|
44
|
+
implementation('com.regula.face:api:7.1.3022'){
|
|
45
45
|
transitive = true
|
|
46
46
|
}
|
|
47
47
|
}
|
package/android/cordova.gradle
CHANGED
|
@@ -6,13 +6,13 @@ android {
|
|
|
6
6
|
|
|
7
7
|
repositories {
|
|
8
8
|
maven {
|
|
9
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
9
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
dependencies {
|
|
14
14
|
//noinspection GradleDependency
|
|
15
|
-
implementation('com.regula.face:api:
|
|
15
|
+
implementation('com.regula.face:api:7.1.3022'){
|
|
16
16
|
transitive = true
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
## How to build demo application
|
|
4
4
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
5
|
|
|
6
|
-
2.
|
|
6
|
+
2. Execute `npm run setup` within this directory.
|
|
7
7
|
|
|
8
8
|
3. Run the app:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* IOS: `npm run ios`.
|
|
10
|
+
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-o` or `--open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offine match
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"setup": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"setup": "scripts/setup.sh",
|
|
8
|
+
"ios": "scripts/ios.sh",
|
|
9
|
+
"android": "scripts/android.sh",
|
|
10
10
|
"dev": "vite",
|
|
11
11
|
"build": "tsc && vite build",
|
|
12
12
|
"preview": "vite preview",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"lint": "eslint"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
19
|
-
"@regulaforensics/face-core-basic": "6.3.
|
|
18
|
+
"@regulaforensics/face-sdk": "6.5.84-beta",
|
|
19
|
+
"@regulaforensics/face-core-basic": "6.3.146-beta",
|
|
20
20
|
"@awesome-cordova-plugins/camera": "6.6.0",
|
|
21
21
|
"@awesome-cordova-plugins/file": "6.6.0",
|
|
22
22
|
"@awesome-cordova-plugins/dialogs": "6.6.0",
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
## How to build demo application
|
|
4
4
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
5
|
|
|
6
|
-
2.
|
|
6
|
+
2. Execute `npm run setup` within this directory.
|
|
7
7
|
|
|
8
8
|
3. Run the app:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* IOS: `npm run ios`.
|
|
10
|
+
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-o` or `--open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offine match
|
|
@@ -4,18 +4,13 @@
|
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"setup": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"setup": "scripts/setup.sh",
|
|
8
|
+
"ios": "scripts/ios.sh",
|
|
9
|
+
"android": "scripts/android.sh"
|
|
10
10
|
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"ecosystem:cordova"
|
|
13
|
-
],
|
|
14
|
-
"author": "Regula Forensics Inc.",
|
|
15
|
-
"license": "commercial",
|
|
16
11
|
"dependencies": {
|
|
17
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
18
|
-
"@regulaforensics/face-core-basic": "6.3.
|
|
12
|
+
"@regulaforensics/face-sdk": "6.5.84-beta",
|
|
13
|
+
"@regulaforensics/face-core-basic": "6.3.146-beta",
|
|
19
14
|
"cordova-android": "13.0.0",
|
|
20
15
|
"cordova-ios": "7.1.1",
|
|
21
16
|
"cordova-plugin-add-swift-support": "2.0.2",
|
|
@@ -36,4 +31,4 @@
|
|
|
36
31
|
"ios"
|
|
37
32
|
]
|
|
38
33
|
}
|
|
39
|
-
}
|
|
34
|
+
}
|
package/examples/ionic/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
## How to build demo application
|
|
4
4
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
5
|
|
|
6
|
-
2.
|
|
6
|
+
2. Execute `npm run setup` within this directory.
|
|
7
7
|
|
|
8
8
|
3. Run the app:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* IOS: `npm run ios`.
|
|
10
|
+
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-o` or `--open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offine match
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"author": "Ionic Framework",
|
|
5
5
|
"homepage": "https://ionicframework.com/",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"setup": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"setup": "scripts/setup.sh",
|
|
8
|
+
"ios": "scripts/ios.sh",
|
|
9
|
+
"android": "scripts/android.sh",
|
|
10
10
|
"ng": "ng",
|
|
11
11
|
"start": "ng serve",
|
|
12
12
|
"build": "ng build",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"private": true,
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
20
|
-
"@regulaforensics/face-core-basic": "6.3.
|
|
19
|
+
"@regulaforensics/face-sdk": "6.5.84-beta",
|
|
20
|
+
"@regulaforensics/face-core-basic": "6.3.146-beta",
|
|
21
21
|
"cordova-plugin-camera": "8.0.0",
|
|
22
22
|
"@awesome-cordova-plugins/camera": "6.14.0",
|
|
23
23
|
"@awesome-cordova-plugins/core": "6.14.0",
|
|
@@ -3,7 +3,7 @@ import { Dialogs } from '@awesome-cordova-plugins/dialogs/ngx'
|
|
|
3
3
|
import { File } from '@awesome-cordova-plugins/file'
|
|
4
4
|
import { Camera, DestinationType, MediaType, PictureSourceType } from '@awesome-cordova-plugins/camera/ngx'
|
|
5
5
|
import { Platform } from '@ionic/angular'
|
|
6
|
-
import { FaceSDK, InitConfig, LivenessSkipStep, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
|
|
6
|
+
import { FaceSDK, MatchFacesRequest, MatchFacesImage, InitConfig, LivenessSkipStep, ImageType, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
|
|
7
7
|
|
|
8
8
|
async function init() {
|
|
9
9
|
if (!await initialize()) return
|
|
@@ -20,14 +20,33 @@ async function startLiveness() {
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
if (response.image == null) return
|
|
23
|
-
setImage(response.image, 1)
|
|
23
|
+
setImage(response.image, ImageType.LIVE, 1)
|
|
24
24
|
setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
async function matchFaces() {
|
|
28
|
+
if (image1 == null || image2 == null) {
|
|
29
|
+
setStatus("Both images required!")
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
setStatus("Processing...")
|
|
33
|
+
var request = new MatchFacesRequest([image1, image2])
|
|
34
|
+
var response = await faceSdk.matchFaces(request)
|
|
35
|
+
var split = await faceSdk.splitComparedFaces(response.results, 0.75)
|
|
36
|
+
var match = split.matchedFaces
|
|
37
|
+
setSimilarityStatus("failed")
|
|
38
|
+
if (match.length > 0)
|
|
39
|
+
setSimilarityStatus((match[0].similarity * 100).toFixed(2) + "%")
|
|
40
|
+
setStatus("Ready")
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
function clearResults() {
|
|
28
44
|
setStatus("Ready")
|
|
45
|
+
setSimilarityStatus("null")
|
|
29
46
|
setLivenessStatus("null")
|
|
30
47
|
resetImages()
|
|
48
|
+
image1 = null
|
|
49
|
+
image2 = null
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
// If 'regula.license' exists, init using license(enables offline match)
|
|
@@ -45,14 +64,40 @@ async function initialize() {
|
|
|
45
64
|
return success
|
|
46
65
|
}
|
|
47
66
|
|
|
48
|
-
function setImage(base64: string, position: number) {
|
|
67
|
+
function setImage(base64: string, type: number, position: number) {
|
|
49
68
|
setSimilarityStatus("null")
|
|
69
|
+
var mfImage = new MatchFacesImage(base64, type)
|
|
50
70
|
if (position == 1) {
|
|
71
|
+
image1 = mfImage
|
|
51
72
|
setUiImage1("data:image/png;base64," + base64)
|
|
52
73
|
setLivenessStatus("null")
|
|
53
74
|
}
|
|
54
|
-
if (position == 2)
|
|
75
|
+
if (position == 2) {
|
|
76
|
+
image2 = mfImage
|
|
55
77
|
setUiImage2("data:image/png;base64," + base64)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function useCamera(position: number) {
|
|
82
|
+
var response = await faceSdk.startFaceCapture()
|
|
83
|
+
if (response.image == null) return
|
|
84
|
+
var image = response.image
|
|
85
|
+
setImage(image.image, image.imageType, position)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function useGallery(position: number) {
|
|
89
|
+
app.camera.getPicture({
|
|
90
|
+
destinationType: DestinationType.DATA_URL,
|
|
91
|
+
mediaType: MediaType.PICTURE,
|
|
92
|
+
sourceType: PictureSourceType.PHOTOLIBRARY
|
|
93
|
+
}).then((result: string) => setImage(result, ImageType.PRINTED, position))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function pickImage(position: number) {
|
|
97
|
+
app.dialogs.confirm("", "Select option", ["Use gallery", "Use camera"]).then(button => {
|
|
98
|
+
if (button == 1) useGallery(position)
|
|
99
|
+
else useCamera(position)
|
|
100
|
+
})
|
|
56
101
|
}
|
|
57
102
|
|
|
58
103
|
async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
@@ -73,7 +118,10 @@ async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
|
73
118
|
}
|
|
74
119
|
|
|
75
120
|
var app: HomePage
|
|
76
|
-
var faceSdk =
|
|
121
|
+
var faceSdk = FaceSDK.instance
|
|
122
|
+
|
|
123
|
+
var image1: MatchFacesImage | null
|
|
124
|
+
var image2: MatchFacesImage | null
|
|
77
125
|
|
|
78
126
|
var setStatus = (data: string) => app.status.nativeElement.innerHTML = data
|
|
79
127
|
var setSimilarityStatus = (data: string) => app.similarityResult.nativeElement.innerHTML = data
|
|
@@ -106,6 +154,9 @@ export class HomePage {
|
|
|
106
154
|
async ionViewDidEnter() {
|
|
107
155
|
app = this
|
|
108
156
|
|
|
157
|
+
app.img1.nativeElement.onclick = () => pickImage(1)
|
|
158
|
+
app.img2.nativeElement.onclick = () => pickImage(2)
|
|
159
|
+
app.matchFacesButton.nativeElement.addEventListener("click", matchFaces)
|
|
109
160
|
app.livenessButton.nativeElement.addEventListener("click", startLiveness)
|
|
110
161
|
app.clearResultsButton.nativeElement.addEventListener("click", clearResults)
|
|
111
162
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
## How to build demo application
|
|
4
4
|
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
5
|
|
|
6
|
-
2.
|
|
6
|
+
2. Execute `npm run setup` within this directory.
|
|
7
7
|
|
|
8
8
|
3. Run the app:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* IOS: `npm run ios`.
|
|
10
|
+
* Android: `npm run android`.
|
|
11
11
|
|
|
12
|
-
**Note**: this is just one way of running the app. You can also
|
|
12
|
+
**Note**: this is just one way of running the app. You can also pass `-o` or `--open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE. Just don't forget to make sure that Metro Bundler is running(`npm start`).
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## How to use offine match
|