@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComparedFace } from './compared_face'
|
|
2
|
+
import { MatchFacesException } from './match_faces_exception'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a result of the {@link ComparedFace} attempt to compare input images.
|
|
6
|
+
*/
|
|
7
|
+
export class ComparedFacesPair {
|
|
8
|
+
/**
|
|
9
|
+
* The first face in the comparison pair.
|
|
10
|
+
*/
|
|
11
|
+
get first(): ComparedFace
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The second face in the comparison pair.
|
|
15
|
+
*/
|
|
16
|
+
get second(): ComparedFace
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Similarity of the faces pair. Floating point value from 0 to 1.
|
|
20
|
+
*/
|
|
21
|
+
get similarity(): number
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The raw value returned by the service without applying any thresholds or comparison rules.
|
|
25
|
+
* The value shows the degree of similarity of compared faces, the lower - the more similar, and vice versa less similar.
|
|
26
|
+
* The `score` is used in conjunction with the input image `imageType` to evaluate `similarity`.
|
|
27
|
+
*/
|
|
28
|
+
get score(): number
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The error describes a failed pair comparison and contains {@link MatchFacesErrorCode} codes.
|
|
32
|
+
*/
|
|
33
|
+
get error(): MatchFacesException | null
|
|
34
|
+
|
|
35
|
+
private constructor()
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MatchFacesImage } from './match_faces_image'
|
|
2
|
+
import { MatchFacesDetectionFace } from './match_faces_detection_face'
|
|
3
|
+
import { MatchFacesException } from './match_faces_exception'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents detection results on an input image as a part of {@link MatchFacesResponse}.
|
|
7
|
+
*/
|
|
8
|
+
export class MatchFacesDetection {
|
|
9
|
+
/**
|
|
10
|
+
* The index to the input image in the input array provided to the request.
|
|
11
|
+
*/
|
|
12
|
+
get imageIndex(): number
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The input image used for comparison operation.
|
|
16
|
+
*/
|
|
17
|
+
get image(): MatchFacesImage
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The array of faces detected on the image.
|
|
21
|
+
*/
|
|
22
|
+
get faces(): Array<MatchFacesDetectionFace>
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The error describes a failed face detection and contains {@link MatchFacesErrorCode} codes.
|
|
26
|
+
*/
|
|
27
|
+
get error(): MatchFacesException | null
|
|
28
|
+
|
|
29
|
+
private constructor()
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Point } from '../image_params/point'
|
|
2
|
+
import { Rect } from '../image_params/rect'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents face detection information as a part of {@link MatchFacesResponse}.
|
|
6
|
+
*/
|
|
7
|
+
export class MatchFacesDetectionFace {
|
|
8
|
+
/**
|
|
9
|
+
* The index of the face detection object in the array of detections.
|
|
10
|
+
*/
|
|
11
|
+
get faceIndex(): number
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Main coordinates of the detected face (eyes, nose, lips, ears and etc.).
|
|
15
|
+
*/
|
|
16
|
+
get landmarks(): Array<Point>
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Rectangular area of the detected face in the original image.
|
|
20
|
+
*/
|
|
21
|
+
get faceRect(): Rect
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Rotation is measured counterclockwise in degrees, with zero indicating
|
|
25
|
+
* that a line drawn between the eyes is horizontal relative to the image orientation.
|
|
26
|
+
*/
|
|
27
|
+
get rotationAngle(): number | null
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Coordinates of the rectangle with the face on the original image prepared for the face crop.
|
|
31
|
+
* Requires {@link OutputImageCrop.returnOriginalRect} is set.
|
|
32
|
+
* Returns `null` if {@link OutputImageCrop.returnOriginalRect} isn't set.
|
|
33
|
+
*/
|
|
34
|
+
get originalRect(): Rect | null
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* String image of the aligned and cropped portrait.
|
|
38
|
+
* Returned if {@link MatchFacesRequest.outputImageParams} is set or predefined scenario is used.
|
|
39
|
+
*/
|
|
40
|
+
get crop(): string | null
|
|
41
|
+
|
|
42
|
+
private constructor()
|
|
43
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MatchFacesBackendException } from './match_faces_backend_exception'
|
|
2
|
+
|
|
3
|
+
export class MatchFacesException {
|
|
4
|
+
get code(): MatchFacesErrorCode
|
|
5
|
+
get message(): string
|
|
6
|
+
get underlyingError(): MatchFacesBackendException | null
|
|
7
|
+
|
|
8
|
+
private constructor()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum MatchFacesErrorCode {
|
|
12
|
+
IMAGE_EMPTY,
|
|
13
|
+
FACE_NOT_DETECTED,
|
|
14
|
+
LANDMARKS_NOT_DETECTED,
|
|
15
|
+
FACE_ALIGNER_FAILED,
|
|
16
|
+
DESCRIPTOR_EXTRACTOR_ERROR,
|
|
17
|
+
IMAGES_COUNT_LIMIT_EXCEEDED,
|
|
18
|
+
API_CALL_FAILED,
|
|
19
|
+
PROCESSING_FAILED,
|
|
20
|
+
NO_LICENSE
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ImageType } from '../face_capture/face_capture_image'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This class represents the input image and its attributes for {@link MatchFacesRequest}.
|
|
5
|
+
*/
|
|
6
|
+
export class MatchFacesImage {
|
|
7
|
+
/**
|
|
8
|
+
* The underlying image.
|
|
9
|
+
*/
|
|
10
|
+
get image(): string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The image type.
|
|
14
|
+
* The imageType influences matching results, therefore this field is required.
|
|
15
|
+
*/
|
|
16
|
+
get imageType(): ImageType
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Defines whether the comparison and detection should apply for all faces found on the image. Defaults to `false`.
|
|
20
|
+
* When set to `false`, only the most centered faces are compared and detected.
|
|
21
|
+
* Otherwise, all the faces are compared and detected.
|
|
22
|
+
*/
|
|
23
|
+
get detectAll(): boolean
|
|
24
|
+
|
|
25
|
+
get identifier(): string
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
image: string,
|
|
29
|
+
imageType: ImageType,
|
|
30
|
+
params?: {
|
|
31
|
+
detectAll?: boolean
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MatchFacesImage } from './match_faces_image'
|
|
2
|
+
import { OutputImageParams } from '../image_params/output_image_params'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compares two or more images with faces on them to find out the similarity of pairs.
|
|
6
|
+
* The request is used as a parameter to {@link FaceSDK.matchFaces}.
|
|
7
|
+
*/
|
|
8
|
+
export class MatchFacesRequest {
|
|
9
|
+
/**
|
|
10
|
+
* Images with faces to match.
|
|
11
|
+
*/
|
|
12
|
+
get images(): Array<MatchFacesImage>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* If set the uploaded image is processed according to the indicated settings.
|
|
16
|
+
*/
|
|
17
|
+
get outputImageParams(): OutputImageParams | null
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Defines tag that can be used in match faces processing. Defaults to `null`.
|
|
21
|
+
*/
|
|
22
|
+
get tag(): string | null
|
|
23
|
+
|
|
24
|
+
get metadata(): Record<string, any> | null
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
images: Array<MatchFacesImage>,
|
|
28
|
+
params?: {
|
|
29
|
+
outputImageParams?: OutputImageParams
|
|
30
|
+
tag?: string
|
|
31
|
+
metadata?: Record<string, any>
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComparedFacesPair } from './compared_faces_pair'
|
|
2
|
+
import { MatchFacesDetection } from './match_faces_detection'
|
|
3
|
+
import { MatchFacesException } from './match_faces_exception'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The response from the {@link MatchFacesRequest}.
|
|
7
|
+
*/
|
|
8
|
+
export class MatchFacesResponse {
|
|
9
|
+
/**
|
|
10
|
+
* Face comparison results with score and similarity values.
|
|
11
|
+
*/
|
|
12
|
+
get results(): Array<ComparedFacesPair>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Face detection results for each given image.
|
|
16
|
+
*/
|
|
17
|
+
get detections(): Array<MatchFacesDetection>
|
|
18
|
+
|
|
19
|
+
get tag(): string | null
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The error describes a failed match faces request and contains {@link MatchFacesErrorCode} codes.
|
|
23
|
+
*/
|
|
24
|
+
get error(): MatchFacesException | null
|
|
25
|
+
|
|
26
|
+
private constructor()
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object that represents uploaded image with its settings.
|
|
3
|
+
*/
|
|
4
|
+
export class ImageUpload {
|
|
5
|
+
/**
|
|
6
|
+
* Creates an object of {@link ImageUpload} using an image.
|
|
7
|
+
*
|
|
8
|
+
* @param imageData - Image base64.
|
|
9
|
+
*/
|
|
10
|
+
static withImageData(imageData: string): ImageUpload
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates an object of {@link ImageUpload} using an image url.
|
|
14
|
+
*
|
|
15
|
+
* @param imageUrl - Image url.
|
|
16
|
+
*/
|
|
17
|
+
static withImageUrl(imageUrl: string): ImageUpload
|
|
18
|
+
|
|
19
|
+
private constructor()
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* A Person Database object that represents Person.
|
|
4
|
+
*/
|
|
5
|
+
export class Person {
|
|
6
|
+
/**
|
|
7
|
+
* Person name.
|
|
8
|
+
* Updatable field.
|
|
9
|
+
*/
|
|
10
|
+
name: string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Person update date.
|
|
14
|
+
*/
|
|
15
|
+
get updatedAt(): Date
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Array if Group IDs Person belongs to.
|
|
19
|
+
*/
|
|
20
|
+
get groups(): string[]
|
|
21
|
+
|
|
22
|
+
get id(): string
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A free-form object containing Person extended attributes.
|
|
26
|
+
* Updatable field.
|
|
27
|
+
*/
|
|
28
|
+
metadata: any
|
|
29
|
+
|
|
30
|
+
get createdAt(): Date
|
|
31
|
+
|
|
32
|
+
private constructor()
|
|
33
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Person } from './person'
|
|
2
|
+
import { PersonImage } from './person_image'
|
|
3
|
+
import { ImageUpload } from './image_upload'
|
|
4
|
+
import { PageableItemList } from './pageable_item_list'
|
|
5
|
+
import { PersonGroup } from './person_group'
|
|
6
|
+
import { EditGroupPersonsRequest } from './edit_group_persons_request'
|
|
7
|
+
import { SearchPersonRequest } from './search_person_request'
|
|
8
|
+
import { SearchPerson } from './search_person'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents Regula Database layer and is the entry point for Person Database operations.
|
|
12
|
+
*/
|
|
13
|
+
export class PersonDatabase {
|
|
14
|
+
createPerson(
|
|
15
|
+
name: string,
|
|
16
|
+
params?: {
|
|
17
|
+
groupIds?: string[],
|
|
18
|
+
metadata?: any,
|
|
19
|
+
}
|
|
20
|
+
): Promise<[Person | null, string | null]>
|
|
21
|
+
|
|
22
|
+
updatePerson(person: Person): Promise<[boolean, string | null]>
|
|
23
|
+
|
|
24
|
+
deletePerson(personId: string): Promise<[boolean, string | null]>
|
|
25
|
+
|
|
26
|
+
getPerson(personId: string): Promise<[Person | null, string | null]>
|
|
27
|
+
|
|
28
|
+
addPersonImage(
|
|
29
|
+
personId: string,
|
|
30
|
+
image: ImageUpload
|
|
31
|
+
): Promise<[PersonImage | null, string | null]>
|
|
32
|
+
|
|
33
|
+
deletePersonImage(
|
|
34
|
+
personId: string,
|
|
35
|
+
imageId: string
|
|
36
|
+
): Promise<[boolean, string | null]>
|
|
37
|
+
|
|
38
|
+
getPersonImage(
|
|
39
|
+
personId: string,
|
|
40
|
+
imageId: string
|
|
41
|
+
): Promise<[PersonImage | null, string | null]>
|
|
42
|
+
|
|
43
|
+
getPersonImages(personId: string): Promise<[PageableItemList<PersonImage>, string | null]>
|
|
44
|
+
|
|
45
|
+
getPersonImagesForPage(
|
|
46
|
+
personId: string,
|
|
47
|
+
page: number,
|
|
48
|
+
size: number
|
|
49
|
+
): Promise<[PageableItemList<PersonImage>, string | null]>
|
|
50
|
+
|
|
51
|
+
createGroup(
|
|
52
|
+
name: string,
|
|
53
|
+
params?: {
|
|
54
|
+
metadata?: any,
|
|
55
|
+
}
|
|
56
|
+
): Promise<[PersonGroup | null, string | null]>
|
|
57
|
+
|
|
58
|
+
updateGroup(group: PersonGroup): Promise<[boolean, string | null]>
|
|
59
|
+
|
|
60
|
+
editPersonsInGroup(
|
|
61
|
+
groupId: string,
|
|
62
|
+
request: EditGroupPersonsRequest
|
|
63
|
+
): Promise<[boolean, string | null]>
|
|
64
|
+
|
|
65
|
+
deleteGroup(groupId: string): Promise<[boolean, string | null]>
|
|
66
|
+
|
|
67
|
+
getGroup(groupId: string): Promise<[PersonGroup | null, string | null]>
|
|
68
|
+
|
|
69
|
+
getGroups(): Promise<[PageableItemList<PersonGroup>, string | null]>
|
|
70
|
+
|
|
71
|
+
getGroupsForPage(
|
|
72
|
+
page: number,
|
|
73
|
+
size: number
|
|
74
|
+
): Promise<[PageableItemList<PersonGroup>, string | null]>
|
|
75
|
+
|
|
76
|
+
getPersonGroups(personId: string): Promise<[PageableItemList<PersonGroup>, string | null]>
|
|
77
|
+
|
|
78
|
+
getPersonGroupsForPage(
|
|
79
|
+
personId: string,
|
|
80
|
+
page: number,
|
|
81
|
+
size: number
|
|
82
|
+
): Promise<[PageableItemList<PersonGroup>, string | null]>
|
|
83
|
+
|
|
84
|
+
getPersonsInGroup(groupId: string): Promise<[PageableItemList<Person>, string | null]>
|
|
85
|
+
|
|
86
|
+
getPersonsInGroupForPage(
|
|
87
|
+
groupId: string,
|
|
88
|
+
page: number,
|
|
89
|
+
size: number
|
|
90
|
+
): Promise<[PageableItemList<Person>, string | null]>
|
|
91
|
+
|
|
92
|
+
searchPerson(request: SearchPersonRequest): Promise<[SearchPerson[] | null, string | null]>
|
|
93
|
+
|
|
94
|
+
private constructor()
|
|
95
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Person Database object that represents Group of {@link Person}.
|
|
3
|
+
*/
|
|
4
|
+
export class PersonGroup {
|
|
5
|
+
/**
|
|
6
|
+
* PersonGroup name.
|
|
7
|
+
* Updatable field.
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
|
|
11
|
+
get id(): string
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A free-form object containing Group extended attributes.
|
|
15
|
+
* Updatable field.
|
|
16
|
+
*/
|
|
17
|
+
metadata: any
|
|
18
|
+
|
|
19
|
+
get createdAt(): Date
|
|
20
|
+
|
|
21
|
+
private constructor()
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SearchPersonImage } from './search_person_image'
|
|
2
|
+
import { SearchPersonDetection } from './search_person_detection'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A Person Database object that represents th result of Person search.
|
|
6
|
+
*/
|
|
7
|
+
export class SearchPerson {
|
|
8
|
+
/**
|
|
9
|
+
* Array of images where the Person is found.
|
|
10
|
+
*/
|
|
11
|
+
get images(): SearchPersonImage[]
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Detection data relative to the search input image.
|
|
15
|
+
*/
|
|
16
|
+
get detection(): SearchPersonDetection | null
|
|
17
|
+
|
|
18
|
+
name: string
|
|
19
|
+
|
|
20
|
+
get updatedAt(): Date
|
|
21
|
+
|
|
22
|
+
get groups(): string[]
|
|
23
|
+
|
|
24
|
+
get id(): string
|
|
25
|
+
|
|
26
|
+
metadata: any
|
|
27
|
+
|
|
28
|
+
get createdAt(): Date
|
|
29
|
+
|
|
30
|
+
private constructor()
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Point } from '../image_params/point'
|
|
2
|
+
import { Rect } from '../image_params/rect'
|
|
3
|
+
|
|
4
|
+
export class SearchPersonDetection {
|
|
5
|
+
get landmarks(): Point[]
|
|
6
|
+
get rect(): Rect
|
|
7
|
+
get crop(): string | null
|
|
8
|
+
get rotationAngle(): number | null
|
|
9
|
+
|
|
10
|
+
private constructor()
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Person Database object that represents Image result of Person Search.
|
|
3
|
+
*/
|
|
4
|
+
export class SearchPersonImage {
|
|
5
|
+
/**
|
|
6
|
+
* The similarity score.
|
|
7
|
+
* From 0.0 to 1.0.
|
|
8
|
+
*/
|
|
9
|
+
get similarity(): number
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The similarity distance score.
|
|
13
|
+
* The lower the distance, the higher the face's similarity.
|
|
14
|
+
* From 0.0 to 2.0.
|
|
15
|
+
*/
|
|
16
|
+
get distance(): number
|
|
17
|
+
get path(): string
|
|
18
|
+
get url(): string
|
|
19
|
+
get contentType(): string | null
|
|
20
|
+
get id(): string
|
|
21
|
+
get metadata(): any
|
|
22
|
+
get createdAt(): Date
|
|
23
|
+
|
|
24
|
+
private constructor()
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ImageUpload } from './image_upload'
|
|
2
|
+
import { OutputImageParams } from '../image_params/output_image_params'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Request object that configures Search settings.
|
|
6
|
+
*/
|
|
7
|
+
export class SearchPersonRequest {
|
|
8
|
+
/**
|
|
9
|
+
* Create {@link SearchPersonRequest} object.
|
|
10
|
+
*
|
|
11
|
+
* @param image - Image Upload object to apply search with.
|
|
12
|
+
*
|
|
13
|
+
* @param params.groupIdsForSearch - The Group IDs of the groups in which the search is performed.
|
|
14
|
+
*
|
|
15
|
+
* @param params.threshold - The similarity distance threshold, should be between 0.0 and 2.0,
|
|
16
|
+
* where 0.0 is for returning results for only the most similar persons and 2.0
|
|
17
|
+
* is for all the persons, even the dissimilar ones.
|
|
18
|
+
* Default: 1.
|
|
19
|
+
*
|
|
20
|
+
* @param params.limit - The number of returned Persons limit.
|
|
21
|
+
* Default: 100.
|
|
22
|
+
*
|
|
23
|
+
* @param params.detectAll - Whether to process only the one face on the image or all the faces.
|
|
24
|
+
* Default: `false`.
|
|
25
|
+
*
|
|
26
|
+
* @param params.outputImageParams - If set the uploaded image is processed according to the indicated settings.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
image: ImageUpload,
|
|
31
|
+
params?: {
|
|
32
|
+
groupIdsForSearch?: string[],
|
|
33
|
+
threshold?: number,
|
|
34
|
+
limit?: number,
|
|
35
|
+
detectAll?: boolean,
|
|
36
|
+
outputImageParams?: OutputImageParams
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|