Skip to content

Commit 391caab

Browse files
unit tests for toNetInput
1 parent f05a5f2 commit 391caab

26 files changed

+602
-474
lines changed

build/drawing/index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { FaceDetection } from '../faceDetectionNet/FaceDetection';
2+
import { FaceLandmarks } from '../faceLandmarkNet/FaceLandmarks';
3+
import { DrawBoxOptions, DrawLandmarksOptions, DrawOptions, DrawTextOptions } from './types';
4+
export declare function getDefaultDrawOptions(): DrawOptions;
5+
export declare function drawBox(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, options: DrawBoxOptions): void;
6+
export declare function drawText(ctx: CanvasRenderingContext2D, x: number, y: number, text: string, options: DrawTextOptions): void;
7+
export declare function drawDetection(canvasArg: string | HTMLCanvasElement, detection: FaceDetection | FaceDetection[], options?: DrawBoxOptions & DrawTextOptions & {
8+
withScore: boolean;
9+
}): void;
10+
export declare function drawLandmarks(canvasArg: string | HTMLCanvasElement, faceLandmarks: FaceLandmarks | FaceLandmarks[], options?: DrawLandmarksOptions & {
11+
drawLines: boolean;
12+
}): void;

build/drawing/index.js

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

build/drawing/index.js.map

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

build/drawing/types.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export declare type DrawBoxOptions = {
2+
lineWidth?: number;
3+
color?: string;
4+
};
5+
export declare type DrawTextOptions = {
6+
lineWidth?: number;
7+
fontSize?: number;
8+
fontStyle?: string;
9+
color?: string;
10+
};
11+
export declare type DrawLandmarksOptions = {
12+
lineWidth?: number;
13+
color?: string;
14+
};
15+
export declare type DrawOptions = {
16+
lineWidth: number;
17+
fontSize: number;
18+
fontStyle: string;
19+
color: string;
20+
};

build/drawing/types.js

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

build/drawing/types.js.map

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

build/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import * as tf from '@tensorflow/tfjs-core';
22
export { tf };
33
export * from './FullFaceDescription';
4+
export * from './NetInput';
45
export * from './Point';
56
export * from './Rect';
7+
export * from './drawing';
68
export * from './euclideanDistance';
79
export * from './extractFaces';
810
export * from './extractFaceTensors';

build/index.js

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

build/index.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/types.d.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,3 @@ export declare type Dimensions = {
55
width: number;
66
height: number;
77
};
8-
export declare type DrawBoxOptions = {
9-
lineWidth?: number;
10-
color?: string;
11-
};
12-
export declare type DrawTextOptions = {
13-
lineWidth?: number;
14-
fontSize?: number;
15-
fontStyle?: string;
16-
color?: string;
17-
};
18-
export declare type DrawLandmarksOptions = {
19-
lineWidth?: number;
20-
color?: string;
21-
};
22-
export declare type DrawOptions = {
23-
lineWidth: number;
24-
fontSize: number;
25-
fontStyle: string;
26-
color: string;
27-
};

0 commit comments

Comments
 (0)