Skip to content

Commit c2d2600

Browse files
EFRS-1236 URL Manfunctioning
1 parent 00319c5 commit c2d2600

File tree

3 files changed

+320
-271
lines changed

3 files changed

+320
-271
lines changed

compreface.d.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1+
declare interface Options {
2+
limit: number,
3+
prediction_count?: number,
4+
face_plugins?: string,
5+
det_prob_threshold?: number,
6+
status?: boolean
7+
}
8+
declare interface FaceCollectionAddOptions {
9+
det_prob_threshold: string
10+
}
11+
12+
declare interface ServiceOptions{
13+
limit: number,
14+
face_plugins?: string,
15+
det_prob_threshold?: number,
16+
status?: boolean
17+
}
18+
119
declare interface Detection {
2-
detect<T>(image_path: string, localOptions?: any): Promise<T>;
20+
detect<T>(image_path: string, localOptions?: ServiceOptions): Promise<T>;
321
}
422

523
declare interface Verification {
6-
verify<T>(source_image_path: string, target_image_path: string, options?: any): Promise<T>
24+
verify<T>(source_image_path: string, target_image_path: string, options: ServiceOptions): Promise<T>
725
}
826

927
declare interface Recognition {
28+
recognize<T>(image_path: string, options: Options): Promise<T>;
1029
getFaceCollection(): FaceCollectionFunctions;
1130
subjectFunctions(): SubjectFunctions;
1231
}
@@ -24,15 +43,15 @@ declare interface FaceCollectionFunctions {
2443
* @param {String} subject
2544
* @returns {Promise}
2645
*/
27-
add<T>(image_path: string, subject: string, options?: any): Promise<T>;
46+
add<T>(image_path: string, subject: string, options?: FaceCollectionAddOptions): Promise<T>;
2847

2948
/**
3049
* Verify face from image
3150
* @param {String} image_path
3251
* @param {String} image_id
3352
* @returns {Promise}
3453
*/
35-
verify<T>(image_path: string, image_id: string, options?: any): Promise<T>,
54+
verify<T>(image_path: string, image_id: string, options?: Options): Promise<T>,
3655

3756
/**
3857
* Delete image by id
@@ -100,7 +119,7 @@ declare interface SubjectFunctions {
100119
}
101120

102121
export declare class CompreFace {
103-
constructor(server: string, port: number, options?: any);
122+
constructor(server: string, port: number, options?: Options);
104123

105124
/**
106125
* Initialize RecognitionService instance

face_founder_demo/src/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CompreFace } from '@exadel/compreface-js-sdk';
22
import './custom.css';
3-
import { useState, useRef } from 'react';
4-
import { Container, Row, Form, Col, Button, ProgressBar, Spinner } from 'react-bootstrap';
3+
import { useState, useRef, useEffect } from 'react';
4+
import { Container, Row, Form, Col, ProgressBar, Spinner } from 'react-bootstrap';
55
import UploadedImage from './components/UploadedImge';
66
import DisplayFoundImages from './components/DisplayFoundImages';
77
import DisplayCropedImage from './components/DisplayCropedImages';
@@ -80,7 +80,7 @@ function App() {
8080
setUploadedImage( myEvent.target.result )
8181
let sendata = myEvent.target.result.split(',')[1];
8282

83-
recognitionService.recognize(sendata, { limit: 10, prediction_count: 100, face_plugins: "age,gender"})
83+
recognitionService.recognize(sendata, { prediction_count: 100, face_plugins: "age,gender"})
8484
.then(res => {
8585
setLoading(false)
8686
setFullData(res.result[0].subjects);

0 commit comments

Comments
 (0)