Skip to content

Commit cc99df4

Browse files
Merge pull request justadudewhohacks#3 from justadudewhohacks/face-extraction
Face extraction
2 parents f7c9038 + d7962a5 commit cc99df4

39 files changed

+1759
-150
lines changed

dist/NetInput.js

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

dist/NetInput.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.

dist/extractFaceTensors.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as tf from '@tensorflow/tfjs-core';
2+
import { FaceDetectionResult } from './faceDetectionNet/FaceDetectionResult';
3+
import { NetInput } from './NetInput';
4+
import { TNetInput } from './types';
5+
/**
6+
* Extracts the tensors of the image regions containing the detected faces.
7+
* Returned tensors have to be disposed manually once you don't need them anymore!
8+
* Useful if you want to compute the face descriptors for the face
9+
* images. Using this method is faster then extracting a canvas for each face and
10+
* converting them to tensors individually.
11+
*
12+
* @param input The image that face detection has been performed on.
13+
* @param detections The face detection results for that image.
14+
* @returns Tensors of the corresponding image region for each detected face.
15+
*/
16+
export declare function extractFaceTensors(image: tf.Tensor | NetInput | TNetInput, detections: FaceDetectionResult[]): tf.Tensor4D[];

dist/extractFaceTensors.js

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

dist/extractFaceTensors.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.

dist/extractFaces.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { FaceDetectionResult } from './faceDetectionNet/FaceDetectionResult';
2+
/**
3+
* Extracts the image regions containing the detected faces.
4+
*
5+
* @param input The image that face detection has been performed on.
6+
* @param detections The face detection results for that image.
7+
* @returns The Canvases of the corresponding image region for each detected face.
8+
*/
9+
export declare function extractFaces(image: HTMLCanvasElement, detections: FaceDetectionResult[]): HTMLCanvasElement[];

dist/extractFaces.js

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

dist/extractFaces.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.

0 commit comments

Comments
 (0)