@@ -467,7 +467,7 @@ const detectionsWithLandmarks = await faceapi
467
467
// resize the detected boxes and landmarks in case your displayed image has a different size than the original
468
468
const resizedResults = faceapi .resizeResults (detectionsWithLandmarks, displaySize)
469
469
// draw detections into the canvas
470
- faceapi .draw .drawDetections (canvas, resizedDetections )
470
+ faceapi .draw .drawDetections (canvas, resizedResults )
471
471
// draw the landmarks into the canvas
472
472
faceapi .draw .drawFaceLandmarks (canvas, resizedResults)
473
473
@@ -480,7 +480,7 @@ const detectionsWithExpressions = await faceapi
480
480
// resize the detected boxes and landmarks in case your displayed image has a different size than the original
481
481
const resizedResults = faceapi .resizeResults (detectionsWithExpressions, displaySize)
482
482
// draw detections into the canvas
483
- faceapi .draw .drawDetections (canvas, resizedDetections )
483
+ faceapi .draw .drawDetections (canvas, resizedResults )
484
484
// draw a textbox displaying the face expressions with minimum probability into the canvas
485
485
const minProbability = 0.05
486
486
faceapi .draw .drawFaceExpressions (canvas, resizedResults, minProbability)
@@ -638,8 +638,6 @@ export interface IBox {
638
638
}
639
639
```
640
640
641
- <a name =" interface-face-detection " ></a >
642
-
643
641
### IFaceDetection
644
642
645
643
``` javascript
@@ -649,8 +647,6 @@ export interface IFaceDetection {
649
647
}
650
648
```
651
649
652
- <a name =" interface-face-landmarks " ></a >
653
-
654
650
### IFaceLandmarks
655
651
656
652
``` javascript
@@ -660,52 +656,59 @@ export interface IFaceLandmarks {
660
656
}
661
657
```
662
658
663
- <a name =" with-face-detection " ></a >
664
-
665
659
### WithFaceDetection
666
660
667
661
``` javascript
668
- export type WithFaceDetection < TSource > TSource & {
662
+ export type WithFaceDetection < TSource > = TSource & {
669
663
detection : FaceDetection
670
664
}
671
665
```
672
666
673
- <a name =" with-face-landmarks " ></a >
674
-
675
667
### WithFaceLandmarks
676
668
677
669
``` javascript
678
- export type WithFaceLandmarks < TSource > TSource & {
670
+ export type WithFaceLandmarks < TSource > = TSource & {
679
671
unshiftedLandmarks : FaceLandmarks
680
672
landmarks : FaceLandmarks
681
673
alignedRect : FaceDetection
682
674
}
683
675
```
684
676
685
- <a name =" with-face-descriptor " ></a >
686
-
687
677
### WithFaceDescriptor
688
678
689
679
``` javascript
690
- export type WithFaceDescriptor < TSource > TSource & {
680
+ export type WithFaceDescriptor < TSource > = TSource & {
691
681
descriptor : Float32Array
692
682
}
693
683
```
694
684
695
- <a name =" with-face-expressions " ></a >
696
-
697
685
### WithFaceExpressions
698
686
699
687
``` javascript
700
- export type FaceExpression = ' neutral' | ' happy' | ' sad' | ' angry' | ' fearful' | ' disgusted' | ' surprised'
688
+ export type WithFaceExpressions < TSource > = TSource & {
689
+ expressions : FaceExpressions
690
+ }
691
+ ```
692
+
693
+ ### WithAge
694
+
695
+ ``` javascript
696
+ export type WithAge < TSource > = TSource & {
697
+ age : number
698
+ }
699
+ ```
701
700
702
- export type FaceExpressionPrediction = {
703
- expression : FaceExpression ,
704
- probability : number
701
+ ### WithGender
702
+
703
+ ``` javascript
704
+ export type WithGender < TSource > = TSource & {
705
+ gender : Gender
706
+ genderProbability : number
705
707
}
706
708
707
- export type WithFaceExpressions < TSource > TSource & {
708
- expressions : FaceExpressionPrediction []
709
+ export enum Gender {
710
+ FEMALE = 'female ',
711
+ MALE = 'male '
709
712
}
710
713
```
711
714
0 commit comments