extractFaceTensors.d.ts 814 B

1234567891011121314
  1. import * as tf from '@tensorflow/tfjs-core';
  2. import { Rect } from '../classes';
  3. import { FaceDetection } from '../classes/FaceDetection';
  4. /**
  5. * Extracts the tensors of the image regions containing the detected faces.
  6. * Useful if you want to compute the face descriptors for the face images.
  7. * Using this method is faster then extracting a canvas for each face and
  8. * converting them to tensors individually.
  9. *
  10. * @param imageTensor The image tensor that face detection has been performed on.
  11. * @param detections The face detection results or face bounding boxes for that image.
  12. * @returns Tensors of the corresponding image region for each detected face.
  13. */
  14. export declare function extractFaceTensors(imageTensor: tf.Tensor3D | tf.Tensor4D, detections: Array<FaceDetection | Rect>): Promise<tf.Tensor3D[]>;