Skip to content

Commit 5be059a

Browse files
withAgeAndGender from detect faces tasks
1 parent d50c2b1 commit 5be059a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/globalApi/DetectFacesTasks.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { TinyFaceDetectorOptions } from '../tinyFaceDetector/TinyFaceDetectorOpt
88
import { ComposableTask } from './ComposableTask';
99
import { DetectAllFaceLandmarksTask, DetectSingleFaceLandmarksTask } from './DetectFaceLandmarksTasks';
1010
import { nets } from './nets';
11+
import { PredictAllAgeAndGenderTask, PredictSingleAgeAndGenderTask } from './PredictAgeAndGenderTask';
1112
import { PredictAllFaceExpressionsTask, PredictSingleFaceExpressionsTask } from './PredictFaceExpressionsTask';
1213
import { FaceDetectionOptions } from './types';
1314

@@ -71,6 +72,13 @@ export class DetectAllFacesTask extends DetectFacesTaskBase<FaceDetection[]> {
7172
this.input
7273
)
7374
}
75+
76+
withAgeAndGender() {
77+
return new PredictAllAgeAndGenderTask(
78+
this.runAndExtendWithFaceDetections(),
79+
this.input
80+
)
81+
}
7482
}
7583

7684
export class DetectSingleFaceTask extends DetectFacesTaskBase<FaceDetection | undefined> {
@@ -108,4 +116,10 @@ export class DetectSingleFaceTask extends DetectFacesTaskBase<FaceDetection | un
108116
)
109117
}
110118

119+
withAgeAndGender() {
120+
return new PredictSingleAgeAndGenderTask(
121+
this.runAndExtendWithFaceDetection(),
122+
this.input
123+
)
124+
}
111125
}

0 commit comments

Comments
 (0)