@@ -179,7 +179,7 @@ Or simply obtain the tensor (tensor has to be disposed manually):
179
179
const t = recognitionNet .forward (' myImg' )
180
180
```
181
181
182
- Compute the Face Descriptors for Detected Faces
182
+ Compute the Face Descriptors for Detected Faces:
183
183
184
184
``` javascript
185
185
const detections = await detectionNet .locateFaces (input)
@@ -217,14 +217,14 @@ Draw the detected face landmarks to a canvas:
217
217
218
218
``` javascript
219
219
// adjust the landmark positions in case your displayed image has a different size then the original
220
- const landmarksForSize = landmarks .forSize (myImg .width , myImg .height ))
220
+ const landmarksForSize = landmarks .forSize (myImg .width , myImg .height )
221
221
const canvas = document .getElementById (' overlay' )
222
222
canvas .width = myImg .width
223
223
canvas .height = myImg .height
224
224
faceapi .drawLandmarks (canvas, landmarksForSize, { drawLines: true })
225
225
```
226
226
227
- Retrieve the face landmark positions
227
+ Retrieve the face landmark positions:
228
228
229
229
``` javascript
230
230
const landmarkPositions = landmarks .getPositions ()
@@ -239,14 +239,14 @@ const leftEyeBbrow = landmarks.getLeftEyeBrow()
239
239
const rightEyeBrow = landmarks .getRightEyeBrow ()
240
240
```
241
241
242
- Compute the Face Landmarks for Detected Faces
242
+ Compute the Face Landmarks for Detected Faces:
243
243
244
244
``` javascript
245
245
const detections = await detectionNet .locateFaces (input)
246
246
247
247
// get the face tensors from the image (have to be disposed manually)
248
248
const faceTensors = await faceapi .extractFaceTensors (input, detections)
249
- const landmarksByFace = await Promise .all (faceTensors .map (t => landmarksNet .detectLandmarks (t)))
249
+ const landmarksByFace = await Promise .all (faceTensors .map (t => faceLandmarkNet .detectLandmarks (t)))
250
250
251
251
// free memory for face image tensors after we computed their descriptors
252
252
faceTensors .forEach (t => t .dispose ())
0 commit comments