1
+ /*
2
+ * Copyright (c) 2020 the original author or authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13
+ * or implied. See the License for the specific language governing
14
+ * permissions and limitations under the License.
15
+ */
16
+
17
+ declare interface Options {
18
+ limit : number ,
19
+ prediction_count ?: number ,
20
+ face_plugins ?: string ,
21
+ det_prob_threshold ?: number ,
22
+ status ?: boolean
23
+ }
24
+ declare interface FaceCollectionAddOptions {
25
+ det_prob_threshold : string
26
+ }
27
+
28
+ declare interface ServiceOptions {
29
+ limit : number ,
30
+ face_plugins ?: string ,
31
+ det_prob_threshold ?: number ,
32
+ status ?: boolean
33
+ }
34
+
1
35
declare interface Detection {
2
- detect < T > ( image_path : string , localOptions ?: any ) : Promise < T > ;
36
+ detect < T > ( image_path : string , localOptions ?: ServiceOptions ) : Promise < T > ;
3
37
}
4
38
5
39
declare interface Verification {
6
- verify < T > ( source_image_path : string , target_image_path : string , options ?: any ) : Promise < T >
40
+ verify < T > ( source_image_path : string , target_image_path : string , options : ServiceOptions ) : Promise < T >
7
41
}
8
42
9
43
declare interface Recognition {
44
+ recognize < T > ( image_path : string , options : Options ) : Promise < T > ;
10
45
getFaceCollection ( ) : FaceCollectionFunctions ;
11
46
subjectFunctions ( ) : SubjectFunctions ;
12
47
}
@@ -24,15 +59,15 @@ declare interface FaceCollectionFunctions {
24
59
* @param {String } subject
25
60
* @returns {Promise }
26
61
*/
27
- add < T > ( image_path : string , subject : string , options ?: any ) : Promise < T > ;
62
+ add < T > ( image_path : string , subject : string , options ?: FaceCollectionAddOptions ) : Promise < T > ;
28
63
29
64
/**
30
65
* Verify face from image
31
66
* @param {String } image_path
32
67
* @param {String } image_id
33
68
* @returns {Promise }
34
69
*/
35
- verify < T > ( image_path : string , image_id : string , options ?: any ) : Promise < T > ,
70
+ verify < T > ( image_path : string , image_id : string , options ?: Options ) : Promise < T > ,
36
71
37
72
/**
38
73
* Delete image by id
@@ -100,7 +135,7 @@ declare interface SubjectFunctions {
100
135
}
101
136
102
137
export declare class CompreFace {
103
- constructor ( server : string , port : number , options ?: any ) ;
138
+ constructor ( server : string , port : number , options ?: Options ) ;
104
139
105
140
/**
106
141
* Initialize RecognitionService instance
0 commit comments