Skip to content

Commit c673097

Browse files
added missing doc for utility classes
1 parent 2388f73 commit c673097

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ const detectionsWithLandmarks = await faceapi
467467
// resize the detected boxes and landmarks in case your displayed image has a different size than the original
468468
const resizedResults = faceapi.resizeResults(detectionsWithLandmarks, displaySize)
469469
// draw detections into the canvas
470-
faceapi.draw.drawDetections(canvas, resizedDetections)
470+
faceapi.draw.drawDetections(canvas, resizedResults)
471471
// draw the landmarks into the canvas
472472
faceapi.draw.drawFaceLandmarks(canvas, resizedResults)
473473

@@ -480,7 +480,7 @@ const detectionsWithExpressions = await faceapi
480480
// resize the detected boxes and landmarks in case your displayed image has a different size than the original
481481
const resizedResults = faceapi.resizeResults(detectionsWithExpressions, displaySize)
482482
// draw detections into the canvas
483-
faceapi.draw.drawDetections(canvas, resizedDetections)
483+
faceapi.draw.drawDetections(canvas, resizedResults)
484484
// draw a textbox displaying the face expressions with minimum probability into the canvas
485485
const minProbability = 0.05
486486
faceapi.draw.drawFaceExpressions(canvas, resizedResults, minProbability)
@@ -638,8 +638,6 @@ export interface IBox {
638638
}
639639
```
640640

641-
<a name="interface-face-detection"></a>
642-
643641
### IFaceDetection
644642

645643
``` javascript
@@ -649,8 +647,6 @@ export interface IFaceDetection {
649647
}
650648
```
651649

652-
<a name="interface-face-landmarks"></a>
653-
654650
### IFaceLandmarks
655651

656652
``` javascript
@@ -660,52 +656,59 @@ export interface IFaceLandmarks {
660656
}
661657
```
662658

663-
<a name="with-face-detection"></a>
664-
665659
### WithFaceDetection
666660

667661
``` javascript
668-
export type WithFaceDetection<TSource> TSource & {
662+
export type WithFaceDetection<TSource> = TSource & {
669663
detection: FaceDetection
670664
}
671665
```
672666

673-
<a name="with-face-landmarks"></a>
674-
675667
### WithFaceLandmarks
676668

677669
``` javascript
678-
export type WithFaceLandmarks<TSource> TSource & {
670+
export type WithFaceLandmarks<TSource> = TSource & {
679671
unshiftedLandmarks: FaceLandmarks
680672
landmarks: FaceLandmarks
681673
alignedRect: FaceDetection
682674
}
683675
```
684676

685-
<a name="with-face-descriptor"></a>
686-
687677
### WithFaceDescriptor
688678

689679
``` javascript
690-
export type WithFaceDescriptor<TSource> TSource & {
680+
export type WithFaceDescriptor<TSource> = TSource & {
691681
descriptor: Float32Array
692682
}
693683
```
694684

695-
<a name="with-face-expressions"></a>
696-
697685
### WithFaceExpressions
698686

699687
``` 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+
```
701700

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
705707
}
706708

707-
export type WithFaceExpressions<TSource> TSource & {
708-
expressions: FaceExpressionPrediction[]
709+
export enum Gender {
710+
FEMALE = 'female',
711+
MALE = 'male'
709712
}
710713
```
711714

0 commit comments

Comments
 (0)