Skip to content

Commit 5f68495

Browse files
check in latest build
1 parent 5b215ad commit 5f68495

21 files changed

+330
-224
lines changed

build/FaceLandmarks.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Point } from './Point';
1+
import { FaceDetection } from './FaceDetection';
2+
import { IPoint, Point } from './Point';
3+
import { Rect } from './Rect';
24
import { Dimensions } from './types';
35
export declare class FaceLandmarks {
46
protected _imageWidth: number;
@@ -11,4 +13,20 @@ export declare class FaceLandmarks {
1113
getImageHeight(): number;
1214
getPositions(): Point[];
1315
getRelativePositions(): Point[];
16+
forSize<T extends FaceLandmarks>(width: number, height: number): T;
17+
shift<T extends FaceLandmarks>(x: number, y: number): T;
18+
shiftByPoint<T extends FaceLandmarks>(pt: IPoint): T;
19+
/**
20+
* Aligns the face landmarks after face detection from the relative positions of the faces
21+
* bounding box, or it's current shift. This function should be used to align the face images
22+
* after face detection has been performed, before they are passed to the face recognition net.
23+
* This will make the computed face descriptor more accurate.
24+
*
25+
* @param detection (optional) The bounding box of the face or the face detection result. If
26+
* no argument was passed the position of the face landmarks are assumed to be relative to
27+
* it's current shift.
28+
* @returns The bounding box of the aligned face.
29+
*/
30+
align(detection?: FaceDetection | Rect): Rect;
31+
protected getRefPointsForAlignment(): Point[];
1432
}

build/FaceLandmarks.js

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/FaceLandmarks.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/FullFaceDescription.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { FaceDetection } from './FaceDetection';
2-
import { FaceLandmarks68 } from './faceLandmarkNet/FaceLandmarks68';
2+
import { FaceLandmarks } from './FaceLandmarks';
33
export declare class FullFaceDescription {
44
private _detection;
55
private _landmarks;
66
private _descriptor;
7-
constructor(_detection: FaceDetection, _landmarks: FaceLandmarks68, _descriptor: Float32Array);
7+
constructor(_detection: FaceDetection, _landmarks: FaceLandmarks, _descriptor: Float32Array);
88
readonly detection: FaceDetection;
9-
readonly landmarks: FaceLandmarks68;
9+
readonly landmarks: FaceLandmarks;
1010
readonly descriptor: Float32Array;
1111
forSize(width: number, height: number): FullFaceDescription;
1212
}

build/FullFaceDescription.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/allFacesFactory.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { FaceDetectionNet } from './faceDetectionNet/FaceDetectionNet';
22
import { FaceLandmarkNet } from './faceLandmarkNet/FaceLandmarkNet';
3-
import { FaceRecognitionNet } from './faceRecognitionNet/FaceRecognitionNet';
43
import { FullFaceDescription } from './FullFaceDescription';
4+
import { Mtcnn } from './mtcnn/Mtcnn';
5+
import { MtcnnForwardParams } from './mtcnn/types';
6+
import { Rect } from './Rect';
57
import { TNetInput } from './types';
6-
export declare function allFacesFactory(detectionNet: FaceDetectionNet, landmarkNet: FaceLandmarkNet, recognitionNet: FaceRecognitionNet): (input: TNetInput, minConfidence: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
8+
export declare function allFacesFactory(detectionNet: FaceDetectionNet, landmarkNet: FaceLandmarkNet, computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>): (input: TNetInput, minConfidence: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
9+
export declare function allFacesMtcnnFactory(mtcnn: Mtcnn, computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>): (input: TNetInput, mtcnnForwardParams: MtcnnForwardParams, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;

build/allFacesFactory.js

Lines changed: 38 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)