Commit c6730978 by vincent

added missing doc for utility classes

parent 2388f732
...@@ -467,7 +467,7 @@ const detectionsWithLandmarks = await faceapi ...@@ -467,7 +467,7 @@ const detectionsWithLandmarks = await faceapi
// resize the detected boxes and landmarks in case your displayed image has a different size than the original // resize the detected boxes and landmarks in case your displayed image has a different size than the original
const resizedResults = faceapi.resizeResults(detectionsWithLandmarks, displaySize) const resizedResults = faceapi.resizeResults(detectionsWithLandmarks, displaySize)
// draw detections into the canvas // draw detections into the canvas
faceapi.draw.drawDetections(canvas, resizedDetections) faceapi.draw.drawDetections(canvas, resizedResults)
// draw the landmarks into the canvas // draw the landmarks into the canvas
faceapi.draw.drawFaceLandmarks(canvas, resizedResults) faceapi.draw.drawFaceLandmarks(canvas, resizedResults)
...@@ -480,7 +480,7 @@ const detectionsWithExpressions = await faceapi ...@@ -480,7 +480,7 @@ const detectionsWithExpressions = await faceapi
// resize the detected boxes and landmarks in case your displayed image has a different size than the original // resize the detected boxes and landmarks in case your displayed image has a different size than the original
const resizedResults = faceapi.resizeResults(detectionsWithExpressions, displaySize) const resizedResults = faceapi.resizeResults(detectionsWithExpressions, displaySize)
// draw detections into the canvas // draw detections into the canvas
faceapi.draw.drawDetections(canvas, resizedDetections) faceapi.draw.drawDetections(canvas, resizedResults)
// draw a textbox displaying the face expressions with minimum probability into the canvas // draw a textbox displaying the face expressions with minimum probability into the canvas
const minProbability = 0.05 const minProbability = 0.05
faceapi.draw.drawFaceExpressions(canvas, resizedResults, minProbability) faceapi.draw.drawFaceExpressions(canvas, resizedResults, minProbability)
...@@ -638,8 +638,6 @@ export interface IBox { ...@@ -638,8 +638,6 @@ export interface IBox {
} }
``` ```
<a name="interface-face-detection"></a>
### IFaceDetection ### IFaceDetection
``` javascript ``` javascript
...@@ -649,8 +647,6 @@ export interface IFaceDetection { ...@@ -649,8 +647,6 @@ export interface IFaceDetection {
} }
``` ```
<a name="interface-face-landmarks"></a>
### IFaceLandmarks ### IFaceLandmarks
``` javascript ``` javascript
...@@ -660,52 +656,59 @@ export interface IFaceLandmarks { ...@@ -660,52 +656,59 @@ export interface IFaceLandmarks {
} }
``` ```
<a name="with-face-detection"></a>
### WithFaceDetection ### WithFaceDetection
``` javascript ``` javascript
export type WithFaceDetection<TSource> TSource & { export type WithFaceDetection<TSource> = TSource & {
detection: FaceDetection detection: FaceDetection
} }
``` ```
<a name="with-face-landmarks"></a>
### WithFaceLandmarks ### WithFaceLandmarks
``` javascript ``` javascript
export type WithFaceLandmarks<TSource> TSource & { export type WithFaceLandmarks<TSource> = TSource & {
unshiftedLandmarks: FaceLandmarks unshiftedLandmarks: FaceLandmarks
landmarks: FaceLandmarks landmarks: FaceLandmarks
alignedRect: FaceDetection alignedRect: FaceDetection
} }
``` ```
<a name="with-face-descriptor"></a>
### WithFaceDescriptor ### WithFaceDescriptor
``` javascript ``` javascript
export type WithFaceDescriptor<TSource> TSource & { export type WithFaceDescriptor<TSource> = TSource & {
descriptor: Float32Array descriptor: Float32Array
} }
``` ```
<a name="with-face-expressions"></a>
### WithFaceExpressions ### WithFaceExpressions
``` javascript ``` javascript
export type FaceExpression = 'neutral' | 'happy' | 'sad' | 'angry' | 'fearful' | 'disgusted' | 'surprised' export type WithFaceExpressions<TSource> = TSource & {
expressions: FaceExpressions
}
```
### WithAge
``` javascript
export type WithAge<TSource> = TSource & {
age: number
}
```
export type FaceExpressionPrediction = { ### WithGender
expression: FaceExpression,
probability: number ``` javascript
export type WithGender<TSource> = TSource & {
gender: Gender
genderProbability: number
} }
export type WithFaceExpressions<TSource> TSource & { export enum Gender {
expressions: FaceExpressionPrediction[] FEMALE = 'female',
MALE = 'male'
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment