@regulaforensics/face-sdk 6.5.67-beta → 6.5.70-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 +1 -1
- package/examples/capacitor/README.md +4 -4
- package/examples/capacitor/package.json +4 -4
- 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 +5 -10
- 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 +4 -4
- 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 +4 -5
- 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 +1 -1
- 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
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { ImageQualityCharacteristic } from './image_quality_characteristic'
|
|
2
|
+
import { ImageQualityRange } from './image_quality_range'
|
|
3
|
+
|
|
4
|
+
export class _Image {
|
|
5
|
+
imageWidth(range) {
|
|
6
|
+
return ImageQualityCharacteristic._create(
|
|
7
|
+
ImageQualityCharacteristicName.IMAGE_WIDTH,
|
|
8
|
+
{ recommended: range }
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
imageHeight(range) {
|
|
13
|
+
return ImageQualityCharacteristic._create(
|
|
14
|
+
ImageQualityCharacteristicName.IMAGE_HEIGHT,
|
|
15
|
+
{ recommended: range }
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
imageWidthToHeight(range) {
|
|
20
|
+
return ImageQualityCharacteristic._create(
|
|
21
|
+
ImageQualityCharacteristicName.IMAGE_WIDTH_TO_HEIGHT,
|
|
22
|
+
{ recommended: range }
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
imageChannelsNumber(channelsNumber) {
|
|
27
|
+
return ImageQualityCharacteristic._create(
|
|
28
|
+
ImageQualityCharacteristicName.IMAGE_CHANNELS_NUMBER,
|
|
29
|
+
{ recommended: ImageQualityRange.withValue(channelsNumber) }
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
paddingRatio(range) {
|
|
34
|
+
return ImageQualityCharacteristic._create(
|
|
35
|
+
ImageQualityCharacteristicName.PADDING_RATIO,
|
|
36
|
+
{ recommended: range }
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
artFace() {
|
|
41
|
+
return ImageQualityCharacteristic._create(
|
|
42
|
+
ImageQualityCharacteristicName.ART_FACE,
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
allRecommended() {
|
|
47
|
+
return [this.artFace()]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class _HeadSizeAndPosition {
|
|
52
|
+
faceMidPointHorizontalPosition() {
|
|
53
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FACE_MID_POINT_HORIZONTAL_POSITION)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
faceMidPointVerticalPosition() {
|
|
57
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FACE_MID_POINT_VERTICAL_POSITION)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
headWidthRatio() {
|
|
61
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.HEAD_WIDTH_RATIO)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
headHeightRatio() {
|
|
65
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.HEAD_HEIGHT_RATIO)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
eyesDistance() {
|
|
69
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYES_DISTANCE)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
yaw() {
|
|
73
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.YAW)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
pitch() {
|
|
77
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.PITCH)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
roll() {
|
|
81
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.ROLL)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
allRecommended() {
|
|
85
|
+
return [
|
|
86
|
+
this.faceMidPointHorizontalPosition(),
|
|
87
|
+
this.faceMidPointVerticalPosition(),
|
|
88
|
+
this.headHeightRatio(),
|
|
89
|
+
this.headWidthRatio(),
|
|
90
|
+
this.eyesDistance(),
|
|
91
|
+
this.yaw(),
|
|
92
|
+
this.pitch(),
|
|
93
|
+
this.roll(),
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export class _FaceImage {
|
|
99
|
+
blurLevel() {
|
|
100
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.BLUR_LEVEL)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
noiseLevel() {
|
|
104
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.NOISE_LEVEL)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
unnaturalSkinTone() {
|
|
108
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.UNNATURAL_SKIN_TONE)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
faceDynamicRange() {
|
|
112
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FACE_DYNAMIC_RANGE)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
allRecommended() {
|
|
116
|
+
return [
|
|
117
|
+
this.blurLevel(),
|
|
118
|
+
this.noiseLevel(),
|
|
119
|
+
this.unnaturalSkinTone(),
|
|
120
|
+
this.faceDynamicRange(),
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export class _Eyes {
|
|
126
|
+
eyeRightClosed() {
|
|
127
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_RIGHT_CLOSED)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
eyeLeftClosed() {
|
|
131
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_LEFT_CLOSED)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
eyeRightOccluded() {
|
|
135
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_RIGHT_OCCLUDED)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
eyeLeftOccluded() {
|
|
139
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_LEFT_OCCLUDED)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
eyesRed() {
|
|
143
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYES_RED)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
eyeRightCoveredWithHair() {
|
|
147
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_RIGHT_COVERED_WITH_HAIR)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
eyeLeftCoveredWithHair() {
|
|
151
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EYE_LEFT_COVERED_WITH_HAIR)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
offGaze() {
|
|
155
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.OFF_GAZE)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
allRecommended() {
|
|
159
|
+
return [
|
|
160
|
+
this.eyeRightClosed(),
|
|
161
|
+
this.eyeLeftClosed(),
|
|
162
|
+
this.eyeRightOccluded(),
|
|
163
|
+
this.eyeLeftOccluded(),
|
|
164
|
+
this.eyesRed(),
|
|
165
|
+
this.eyeRightCoveredWithHair(),
|
|
166
|
+
this.eyeLeftCoveredWithHair(),
|
|
167
|
+
this.offGaze(),
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export class _ShadowsAndLightning {
|
|
173
|
+
tooDark() {
|
|
174
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.TOO_DARK)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
tooLight() {
|
|
178
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.TOO_LIGHT)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
faceGlare() {
|
|
182
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FACE_GLARE)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
shadowsOnFace() {
|
|
186
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.SHADOWS_ON_FACE)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
allRecommended() {
|
|
190
|
+
return [
|
|
191
|
+
this.tooDark(),
|
|
192
|
+
this.tooLight(),
|
|
193
|
+
this.faceGlare(),
|
|
194
|
+
this.shadowsOnFace(),
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export class _PoseAndExpression {
|
|
200
|
+
shouldersPose() {
|
|
201
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.SHOULDERS_POSE)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
expressionLevel() {
|
|
205
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.EXPRESSION_LEVEL)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
mouthOpen() {
|
|
209
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.MOUTH_OPEN)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
smile() {
|
|
213
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.SMILE)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
allRecommended() {
|
|
217
|
+
return [
|
|
218
|
+
this.shouldersPose(),
|
|
219
|
+
this.expressionLevel(),
|
|
220
|
+
this.mouthOpen(),
|
|
221
|
+
this.smile(),
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export class _HeadOcclusion {
|
|
227
|
+
darkGlasses() {
|
|
228
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.DARK_GLASSES)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
reflectionOnGlasses() {
|
|
232
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.REFLECTION_ON_GLASSES)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
framesTooHeavy() {
|
|
236
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FRAMES_TOO_HEAVY)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
faceOccluded() {
|
|
240
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FACE_OCCLUDED)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
headCovering() {
|
|
244
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.HEAD_COVERING)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
foreheadCovering() {
|
|
248
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.FOREHEAD_COVERING)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
strongMakeup() {
|
|
252
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.STRONG_MAKEUP)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
headphones() {
|
|
256
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.HEAD_PHONES)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
medicalMask() {
|
|
260
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.MEDICAL_MASK)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
allRecommended() {
|
|
264
|
+
return [
|
|
265
|
+
this.darkGlasses(),
|
|
266
|
+
this.reflectionOnGlasses(),
|
|
267
|
+
this.framesTooHeavy(),
|
|
268
|
+
this.faceOccluded(),
|
|
269
|
+
this.headCovering(),
|
|
270
|
+
this.foreheadCovering(),
|
|
271
|
+
this.strongMakeup(),
|
|
272
|
+
this.headphones(),
|
|
273
|
+
this.medicalMask(),
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export class _Background {
|
|
279
|
+
backgroundUniformity() {
|
|
280
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.BACKGROUND_UNIFORMITY)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
shadowsOnBackground() {
|
|
284
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.SHADOWS_ON_BACKGROUND)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
otherFaces() {
|
|
288
|
+
return ImageQualityCharacteristic._create(ImageQualityCharacteristicName.OTHER_FACES)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
backgroundColorMatch(params) {
|
|
292
|
+
return ImageQualityCharacteristic._create(
|
|
293
|
+
ImageQualityCharacteristicName.BACKGROUND_COLOR_MATCH,
|
|
294
|
+
{ color: params?.color }
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
allRecommended() {
|
|
299
|
+
return [
|
|
300
|
+
this.backgroundUniformity(),
|
|
301
|
+
this.shadowsOnBackground(),
|
|
302
|
+
this.otherFaces(),
|
|
303
|
+
this.backgroundColorMatch(),
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export class ImageQualityGroup {
|
|
309
|
+
static get image() { return ImageQualityGroup._image }
|
|
310
|
+
static _image = new _Image()
|
|
311
|
+
|
|
312
|
+
static get headSizeAndPosition() { return ImageQualityGroup._headSizeAndPosition }
|
|
313
|
+
static _headSizeAndPosition = new _HeadSizeAndPosition()
|
|
314
|
+
|
|
315
|
+
static get faceImage() { return ImageQualityGroup._faceImage }
|
|
316
|
+
static _faceImage = new _FaceImage()
|
|
317
|
+
|
|
318
|
+
static get eyes() { return ImageQualityGroup._eyes }
|
|
319
|
+
static _eyes = new _Eyes()
|
|
320
|
+
|
|
321
|
+
static get shadowsAndLightning() { return ImageQualityGroup._shadowsAndLightning }
|
|
322
|
+
static _shadowsAndLightning = new _ShadowsAndLightning()
|
|
323
|
+
|
|
324
|
+
static get poseAndExpression() { return ImageQualityGroup._poseAndExpression }
|
|
325
|
+
static _poseAndExpression = new _PoseAndExpression()
|
|
326
|
+
|
|
327
|
+
static get headOcclusion() { return ImageQualityGroup._headOcclusion }
|
|
328
|
+
static _headOcclusion = new _HeadOcclusion()
|
|
329
|
+
|
|
330
|
+
static get background() { return ImageQualityGroup._background }
|
|
331
|
+
static _background = new _Background()
|
|
332
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class ImageQualityRange {
|
|
2
|
+
min
|
|
3
|
+
max
|
|
4
|
+
|
|
5
|
+
constructor(min, max) {
|
|
6
|
+
this.min = min
|
|
7
|
+
this.max = max
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static withValue(value) {
|
|
11
|
+
var result = new ImageQualityRange()
|
|
12
|
+
result.min = value
|
|
13
|
+
result.max = value
|
|
14
|
+
return result
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static fromJson(jsonObject) {
|
|
18
|
+
if (jsonObject == null) return null
|
|
19
|
+
const result = new ImageQualityRange()
|
|
20
|
+
|
|
21
|
+
result.min = jsonObject["min"]
|
|
22
|
+
result.max = jsonObject["max"]
|
|
23
|
+
|
|
24
|
+
return result
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ImageQualityRange } from './image_quality_range'
|
|
2
|
+
|
|
3
|
+
export class ImageQualityResult {
|
|
4
|
+
group
|
|
5
|
+
name
|
|
6
|
+
status
|
|
7
|
+
value
|
|
8
|
+
range
|
|
9
|
+
|
|
10
|
+
static fromJson(jsonObject) {
|
|
11
|
+
if (jsonObject == null) return null
|
|
12
|
+
const result = new ImageQualityResult()
|
|
13
|
+
|
|
14
|
+
result.name = jsonObject["name"]
|
|
15
|
+
result.group = jsonObject["group"]
|
|
16
|
+
result.status = jsonObject["status"]
|
|
17
|
+
result.range = ImageQualityRange.fromJson(jsonObject["range"])
|
|
18
|
+
result.value = jsonObject["value"]
|
|
19
|
+
|
|
20
|
+
return result
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ImageQualityGroupName = {
|
|
25
|
+
IMAGE_CHARACTERISTICS: 1,
|
|
26
|
+
HEAD_SIZE_AND_POSITION: 2,
|
|
27
|
+
FACE_QUALITY: 3,
|
|
28
|
+
EYES_CHARACTERISTICS: 4,
|
|
29
|
+
SHADOWS_AND_LIGHTNING: 5,
|
|
30
|
+
POSE_AND_EXPRESSION: 6,
|
|
31
|
+
HEAD_OCCLUSION: 7,
|
|
32
|
+
BACKGROUND: 8,
|
|
33
|
+
UNKNOWN: 9,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const ImageQualityResultStatus = {
|
|
37
|
+
FALSE: 0,
|
|
38
|
+
TRUE: 1,
|
|
39
|
+
UNDETERMINED: 2,
|
|
40
|
+
}
|
|
@@ -1,24 +1,146 @@
|
|
|
1
1
|
import { exec, _setVideoEncoderCompletion, _setLivenessNotificationCompletion, _setCameraSwitchCallback } from './internal/bridge'
|
|
2
2
|
|
|
3
|
+
import { CameraPosition } from './customization/camera_position'
|
|
4
|
+
import { CustomizationColors } from './customization/customization_colors'
|
|
5
|
+
import { CustomizationFonts } from './customization/customization_fonts'
|
|
6
|
+
import { CustomizationImages } from './customization/customization_images'
|
|
7
|
+
import { Customization } from './customization/customization'
|
|
8
|
+
import { Font } from './customization/font'
|
|
9
|
+
import { ScreenOrientation } from './customization/screen_orientation'
|
|
10
|
+
|
|
11
|
+
export { CameraPosition, CustomizationColors, CustomizationFonts, CustomizationImages, Customization, Font, ScreenOrientation }
|
|
12
|
+
|
|
13
|
+
import { FaceSDKVersion } from './init/face_sdk_version'
|
|
3
14
|
import { InitConfig } from './init/init_config'
|
|
4
15
|
import { InitException } from './init/init_exception'
|
|
5
16
|
import { InitErrorCode } from './init/init_exception'
|
|
6
17
|
import { LicenseException } from './init/license_exception'
|
|
7
18
|
import { LicensingResultCode } from './init/license_exception'
|
|
8
19
|
|
|
9
|
-
export { InitConfig, InitException, InitErrorCode, LicenseException, LicensingResultCode }
|
|
20
|
+
export { FaceSDKVersion, InitConfig, InitException, InitErrorCode, LicenseException, LicensingResultCode }
|
|
21
|
+
|
|
22
|
+
import { DetectFaceResult } from './detect_faces/detect_face_result'
|
|
23
|
+
import { DetectFacesAttributeResult } from './detect_faces/detect_faces_attribute_result'
|
|
24
|
+
import { DetectFacesAttribute } from './detect_faces/detect_faces_attribute'
|
|
25
|
+
import { DetectFacesBackendException, DetectFacesBackendErrorCode } from './detect_faces/detect_faces_backend_exception'
|
|
26
|
+
import { DetectFacesConfig } from './detect_faces/detect_faces_config'
|
|
27
|
+
import { DetectFacesException, DetectFacesErrorCode } from './detect_faces/detect_faces_exception'
|
|
28
|
+
import { DetectFacesRequest } from './detect_faces/detect_faces_request'
|
|
29
|
+
import { DetectFacesResponse } from './detect_faces/detect_faces_response'
|
|
30
|
+
import { DetectFacesScenario } from './detect_faces/detect_faces_scenario'
|
|
31
|
+
|
|
32
|
+
export { DetectFaceResult, DetectFacesAttributeResult, DetectFacesAttribute, DetectFacesBackendException, DetectFacesBackendErrorCode, DetectFacesConfig, DetectFacesException, DetectFacesErrorCode, DetectFacesRequest, DetectFacesResponse, DetectFacesScenario }
|
|
33
|
+
|
|
34
|
+
import { FaceCaptureConfig } from './face_capture/face_capture_config'
|
|
35
|
+
import { FaceCaptureException, FaceCaptureErrorCode } from './face_capture/face_capture_exception'
|
|
36
|
+
import { FaceCaptureImage, ImageType } from './face_capture/face_capture_image'
|
|
37
|
+
import { FaceCaptureResponse } from './face_capture/face_capture_response'
|
|
38
|
+
|
|
39
|
+
export { FaceCaptureConfig, FaceCaptureException, FaceCaptureErrorCode, FaceCaptureImage, ImageType, FaceCaptureResponse }
|
|
40
|
+
|
|
41
|
+
import { OutputImageCrop, OutputImageCropAspectRatio } from './image_params/output_image_crop'
|
|
42
|
+
import { OutputImageParams } from './image_params/output_image_params'
|
|
43
|
+
import { Point } from './image_params/point'
|
|
44
|
+
import { Rect } from './image_params/rect'
|
|
45
|
+
import { Size } from './image_params/size'
|
|
46
|
+
|
|
47
|
+
export { OutputImageCrop, OutputImageCropAspectRatio, OutputImageParams, Point, Rect, Size }
|
|
48
|
+
|
|
49
|
+
import { ImageQualityCharacteristicName } from './image_quality/image_quality_characteristic_name'
|
|
50
|
+
import { ImageQualityCharacteristic } from './image_quality/image_quality_characteristic'
|
|
51
|
+
import { ImageQualityGroup } from './image_quality/image_quality_group'
|
|
52
|
+
import { ImageQualityRange } from './image_quality/image_quality_range'
|
|
53
|
+
import { ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus } from './image_quality/image_quality_result'
|
|
54
|
+
|
|
55
|
+
export { ImageQualityCharacteristicName, ImageQualityCharacteristic, ImageQualityGroup, ImageQualityRange, ImageQualityResult, ImageQualityGroupName, ImageQualityResultStatus }
|
|
10
56
|
|
|
11
|
-
import { CameraPosition } from './customization/camera_position'
|
|
12
|
-
import { ScreenOrientation } from './customization/screen_orientation'
|
|
13
57
|
import { LivenessBackendException, LivenessBackendErrorCode } from './liveness/liveness_backend_exception'
|
|
14
58
|
import { LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep } from './liveness/liveness_config'
|
|
15
59
|
import { LivenessException, LivenessErrorCode } from './liveness/liveness_exception'
|
|
16
60
|
import { LivenessNotification, LivenessProcessStatus } from './liveness/liveness_notification'
|
|
17
61
|
import { LivenessResponse, LivenessStatus } from './liveness/liveness_response'
|
|
18
62
|
|
|
19
|
-
export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessResponse, LivenessStatus
|
|
63
|
+
export { LivenessBackendException, LivenessBackendErrorCode, LivenessConfig, RecordingProcess, LivenessType, LivenessSkipStep, LivenessException, LivenessErrorCode, LivenessNotification, LivenessProcessStatus, LivenessResponse, LivenessStatus }
|
|
64
|
+
|
|
65
|
+
import { ComparedFace } from './match_faces/compared_face'
|
|
66
|
+
import { ComparedFacesPair } from './match_faces/compared_faces_pair'
|
|
67
|
+
import { ComparedFacesSplit } from './match_faces/compared_faces_split'
|
|
68
|
+
import { MatchFacesBackendException } from './match_faces/match_faces_backend_exception'
|
|
69
|
+
import { MatchFacesConfig, ProcessingMode } from './match_faces/match_faces_config'
|
|
70
|
+
import { MatchFacesDetectionFace } from './match_faces/match_faces_detection_face'
|
|
71
|
+
import { MatchFacesDetection } from './match_faces/match_faces_detection'
|
|
72
|
+
import { MatchFacesException, MatchFacesErrorCode } from './match_faces/match_faces_exception'
|
|
73
|
+
import { MatchFacesImage } from './match_faces/match_faces_image'
|
|
74
|
+
import { MatchFacesRequest } from './match_faces/match_faces_request'
|
|
75
|
+
import { MatchFacesResponse } from './match_faces/match_faces_response'
|
|
76
|
+
|
|
77
|
+
export { ComparedFace, ComparedFacesPair, ComparedFacesSplit, MatchFacesBackendException, MatchFacesConfig, ProcessingMode, MatchFacesDetectionFace, MatchFacesDetection, MatchFacesException, MatchFacesErrorCode, MatchFacesImage, MatchFacesRequest, MatchFacesResponse }
|
|
78
|
+
|
|
79
|
+
import { EditGroupPersonsRequest } from './person_database/edit_group_persons_request'
|
|
80
|
+
import { ImageUpload } from './person_database/image_upload'
|
|
81
|
+
import { PageableItemList } from './person_database/pageable_item_list'
|
|
82
|
+
import { PersonDatabase } from './person_database/person_database'
|
|
83
|
+
import { PersonGroup } from './person_database/person_group'
|
|
84
|
+
import { PersonImage } from './person_database/person_image'
|
|
85
|
+
import { Person } from './person_database/person'
|
|
86
|
+
import { SearchPersonDetection } from './person_database/search_person_detection'
|
|
87
|
+
import { SearchPersonImage } from './person_database/search_person_image'
|
|
88
|
+
import { SearchPersonRequest } from './person_database/search_person_request'
|
|
89
|
+
import { SearchPerson } from './person_database/search_person'
|
|
90
|
+
|
|
91
|
+
export { EditGroupPersonsRequest, ImageUpload, PageableItemList, PersonDatabase, PersonGroup, PersonImage, Person, SearchPersonDetection, SearchPersonImage, SearchPersonRequest, SearchPerson }
|
|
92
|
+
|
|
20
93
|
|
|
21
94
|
export class FaceSDK {
|
|
95
|
+
static get instance() { return FaceSDK._instance }
|
|
96
|
+
static _instance = new FaceSDK()
|
|
97
|
+
|
|
98
|
+
get version() { return this._version }
|
|
99
|
+
_version
|
|
100
|
+
|
|
101
|
+
get serviceUrl() { return this._serviceUrl }
|
|
102
|
+
_serviceUrl
|
|
103
|
+
set serviceUrl(val) {
|
|
104
|
+
this._serviceUrl = val
|
|
105
|
+
this._setServiceUrl(val)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get localizationDictionary() { return this._localizationDictionary }
|
|
109
|
+
_localizationDictionary
|
|
110
|
+
set localizationDictionary(val) {
|
|
111
|
+
var temp = Object.assign({}, val);
|
|
112
|
+
Object.freeze(temp);
|
|
113
|
+
this._localizationDictionary = temp
|
|
114
|
+
this._setLocalizationDictionary(val)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get requestHeaders() { return this._requestHeaders }
|
|
118
|
+
_requestHeaders
|
|
119
|
+
set requestHeaders(val) {
|
|
120
|
+
var temp = Object.assign({}, val);
|
|
121
|
+
Object.freeze(temp);
|
|
122
|
+
this._requestHeaders = temp
|
|
123
|
+
this._setRequestHeaders(val)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
get customization() { return this._customization }
|
|
127
|
+
_customization = new Customization()
|
|
128
|
+
set customization(val) {
|
|
129
|
+
this._customization = val
|
|
130
|
+
this._customization._apply()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
set videoEncoderCompletion(completion) {
|
|
134
|
+
_setVideoEncoderCompletion(completion)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
get personDatabase() { return this._personDatabase }
|
|
138
|
+
_personDatabase = new PersonDatabase()
|
|
139
|
+
|
|
140
|
+
async isInitialized() {
|
|
141
|
+
return await exec("isInitialized", [])
|
|
142
|
+
}
|
|
143
|
+
|
|
22
144
|
async initialize(params) {
|
|
23
145
|
var response = await exec("initialize", [params?.config])
|
|
24
146
|
|
|
@@ -26,6 +148,8 @@ export class FaceSDK {
|
|
|
26
148
|
var success = jsonObject["success"]
|
|
27
149
|
var error = jsonObject["error"]
|
|
28
150
|
|
|
151
|
+
if (success) await this._onInit()
|
|
152
|
+
|
|
29
153
|
return [success, InitException.fromJson(error)]
|
|
30
154
|
}
|
|
31
155
|
|
|
@@ -33,6 +157,16 @@ export class FaceSDK {
|
|
|
33
157
|
exec("deinitialize", [])
|
|
34
158
|
}
|
|
35
159
|
|
|
160
|
+
async startFaceCapture(params) {
|
|
161
|
+
_setCameraSwitchCallback(params?.cameraSwitchCallback)
|
|
162
|
+
var response = await exec("startFaceCapture", [params?.config])
|
|
163
|
+
return FaceCaptureResponse.fromJson(JSON.parse(response))
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
stopFaceCapture() {
|
|
167
|
+
exec("stopFaceCapture", [])
|
|
168
|
+
}
|
|
169
|
+
|
|
36
170
|
async startLiveness(params) {
|
|
37
171
|
_setCameraSwitchCallback(params?.cameraSwitchCallback)
|
|
38
172
|
_setLivenessNotificationCompletion(params?.notificationCompletion)
|
|
@@ -43,4 +177,45 @@ export class FaceSDK {
|
|
|
43
177
|
stopLiveness() {
|
|
44
178
|
exec("stopLiveness", [])
|
|
45
179
|
}
|
|
180
|
+
|
|
181
|
+
async matchFaces(request, params) {
|
|
182
|
+
var response = await exec("matchFaces", [request, params?.config])
|
|
183
|
+
return MatchFacesResponse.fromJson(JSON.parse(response))
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async splitComparedFaces(facesPairs, similarityThreshold) {
|
|
187
|
+
var response = await exec("splitComparedFaces", [facesPairs, similarityThreshold])
|
|
188
|
+
return ComparedFacesSplit.fromJson(JSON.parse(response))
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async detectFaces(request) {
|
|
192
|
+
var response = await exec("detectFaces", [request])
|
|
193
|
+
return DetectFacesResponse.fromJson(JSON.parse(response))
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async _onInit() {
|
|
197
|
+
this._version = await this._getVersion()
|
|
198
|
+
this._serviceUrl = await this._getServiceUrl()
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async _getVersion() {
|
|
202
|
+
var response = await exec("getVersion", [])
|
|
203
|
+
return FaceSDKVersion.fromJson(JSON.parse(response))
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async _getServiceUrl() {
|
|
207
|
+
return await exec("getServiceUrl", [])
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
_setServiceUrl(url) {
|
|
211
|
+
exec("setServiceUrl", [url])
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
_setLocalizationDictionary(dictionary) {
|
|
215
|
+
exec("setLocalizationDictionary", [dictionary])
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
_setRequestHeaders(dictionary) {
|
|
219
|
+
exec("setRequestHeaders", [dictionary])
|
|
220
|
+
}
|
|
46
221
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class FaceSDKVersion {
|
|
2
|
+
api
|
|
3
|
+
core
|
|
4
|
+
coreMode
|
|
5
|
+
|
|
6
|
+
static fromJson(jsonObject) {
|
|
7
|
+
if (jsonObject == null) return null
|
|
8
|
+
const result = new FaceSDKVersion()
|
|
9
|
+
|
|
10
|
+
result.api = jsonObject["api"]
|
|
11
|
+
result.core = jsonObject["core"]
|
|
12
|
+
result.coreMode = jsonObject["coreMode"]
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MatchFacesImage } from './match_faces_image'
|
|
2
|
+
import { MatchFacesDetectionFace } from './match_faces_detection_face'
|
|
3
|
+
|
|
4
|
+
export class ComparedFace {
|
|
5
|
+
imageIndex
|
|
6
|
+
image
|
|
7
|
+
faceIndex
|
|
8
|
+
face
|
|
9
|
+
|
|
10
|
+
static fromJson(jsonObject) {
|
|
11
|
+
if (jsonObject == null) return null
|
|
12
|
+
const result = new ComparedFace()
|
|
13
|
+
|
|
14
|
+
result.imageIndex = jsonObject["imageIndex"]
|
|
15
|
+
result.image = MatchFacesImage.fromJson(jsonObject["image"])
|
|
16
|
+
result.faceIndex = jsonObject["faceIndex"]
|
|
17
|
+
result.face = MatchFacesDetectionFace.fromJson(jsonObject["face"])
|
|
18
|
+
|
|
19
|
+
return result
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComparedFace } from './compared_face'
|
|
2
|
+
import { MatchFacesException } from './match_faces_exception'
|
|
3
|
+
|
|
4
|
+
export class ComparedFacesPair {
|
|
5
|
+
first
|
|
6
|
+
second
|
|
7
|
+
similarity
|
|
8
|
+
score
|
|
9
|
+
error
|
|
10
|
+
|
|
11
|
+
static fromJson(jsonObject) {
|
|
12
|
+
if (jsonObject == null) return null
|
|
13
|
+
const result = new ComparedFacesPair()
|
|
14
|
+
|
|
15
|
+
result.first = ComparedFace.fromJson(jsonObject["first"])
|
|
16
|
+
result.second = ComparedFace.fromJson(jsonObject["second"])
|
|
17
|
+
result.similarity = jsonObject["similarity"]
|
|
18
|
+
result.score = jsonObject["score"]
|
|
19
|
+
result.error = MatchFacesException.fromJson(jsonObject["error"])
|
|
20
|
+
|
|
21
|
+
return result
|
|
22
|
+
}
|
|
23
|
+
}
|