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+
135declare interface Detection {
2- detect < T > ( image_path : string , localOptions ?: any ) : Promise < T > ;
36+ detect < T > ( image_path : string , localOptions ?: ServiceOptions ) : Promise < T > ;
337}
438
539declare 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 >
741}
842
943declare interface Recognition {
44+ recognize < T > ( image_path : string , options : Options ) : Promise < T > ;
1045 getFaceCollection ( ) : FaceCollectionFunctions ;
1146 subjectFunctions ( ) : SubjectFunctions ;
1247}
@@ -24,15 +59,15 @@ declare interface FaceCollectionFunctions {
2459 * @param {String } subject
2560 * @returns {Promise }
2661 */
27- add < T > ( image_path : string , subject : string , options ?: any ) : Promise < T > ;
62+ add < T > ( image_path : string , subject : string , options ?: FaceCollectionAddOptions ) : Promise < T > ;
2863
2964 /**
3065 * Verify face from image
3166 * @param {String } image_path
3267 * @param {String } image_id
3368 * @returns {Promise }
3469 */
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 > ,
3671
3772 /**
3873 * Delete image by id
@@ -100,7 +135,7 @@ declare interface SubjectFunctions {
100135}
101136
102137export declare class CompreFace {
103- constructor ( server : string , port : number , options ?: any ) ;
138+ constructor ( server : string , port : number , options ?: Options ) ;
104139
105140 /**
106141 * Initialize RecognitionService instance
0 commit comments