DetectFacesTasks.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { FaceDetection } from '../classes/FaceDetection';
  2. import { TNetInput } from '../dom';
  3. import { ComposableTask } from './ComposableTask';
  4. import { DetectAllFaceLandmarksTask, DetectSingleFaceLandmarksTask } from './DetectFaceLandmarksTasks';
  5. import { PredictAllAgeAndGenderTask, PredictSingleAgeAndGenderTask } from './PredictAgeAndGenderTask';
  6. import { PredictAllFaceExpressionsTask, PredictSingleFaceExpressionsTask } from './PredictFaceExpressionsTask';
  7. import { FaceDetectionOptions } from './types';
  8. export declare class DetectFacesTaskBase<TReturn> extends ComposableTask<TReturn> {
  9. protected input: TNetInput;
  10. protected options: FaceDetectionOptions;
  11. constructor(input: TNetInput, options?: FaceDetectionOptions);
  12. }
  13. export declare class DetectAllFacesTask extends DetectFacesTaskBase<FaceDetection[]> {
  14. run(): Promise<FaceDetection[]>;
  15. private runAndExtendWithFaceDetections;
  16. withFaceLandmarks(useTinyLandmarkNet?: boolean): DetectAllFaceLandmarksTask<{
  17. detection: FaceDetection;
  18. }>;
  19. withFaceExpressions(): PredictAllFaceExpressionsTask<{
  20. detection: FaceDetection;
  21. }>;
  22. withAgeAndGender(): PredictAllAgeAndGenderTask<{
  23. detection: FaceDetection;
  24. }>;
  25. }
  26. export declare class DetectSingleFaceTask extends DetectFacesTaskBase<FaceDetection | undefined> {
  27. run(): Promise<FaceDetection | undefined>;
  28. private runAndExtendWithFaceDetection;
  29. withFaceLandmarks(useTinyLandmarkNet?: boolean): DetectSingleFaceLandmarksTask<{
  30. detection: FaceDetection;
  31. }>;
  32. withFaceExpressions(): PredictSingleFaceExpressionsTask<{
  33. detection: FaceDetection;
  34. }>;
  35. withAgeAndGender(): PredictSingleAgeAndGenderTask<{
  36. detection: FaceDetection;
  37. }>;
  38. }