JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
deprecations:
breaking changes:
features:
breaking API changes:
FaceExpressionNet.predictExpressions returns FaceExpressions instance instead of array now
withFaceLandmarks() has to come first after detectAllFaces, detectSingleFace now, since its possible now to use face alignment for face classifcation to achieve more stable prediction results for face classification (expression, age and gender prediction):
await faceapi.detectAllFaces(input).withFaceExpressions().withFaceLandmarks()
-> await faceapi.detectAllFaces(input).withFaceLandmarks().withFaceExpressions()
await faceapi.detectAllFaces(input).withFaceLandmarks().withFaceExpressions().withFaceDescriptors()
-> await faceapi.detectAllFaces(input).withFaceLandmarks().withFaceExpressions().withFaceDescriptors()
await faceapi.detectSingleFace(input).withFaceExpressions().withFaceLandmarks()
-> await faceapi.detectSingleFace(input).withFaceLandmarks().withFaceExpressions()
await faceapi.detectSingleFace(input).withFaceExpressions().withFaceLandmarks().withFaceDescriptor()
-> await faceapi.detectSingleFace(input).withFaceLandmarks().withFaceExpressions().withFaceDescriptor()
fixes:
Features:
Breaking Changes:
The following two utility classes have been replaced: FaceDetectionWithLandmarks, FullFaceDescription. Now, plain objects are returned from the corresponding function calls instead of instances of abovementioned classes, which have to be resized by faceapi.resizeResults(results, { width: <width>, height: <height> })
instead of results.map(res => res.forSize(width, height))
:
export function resizeResults<T>(results: T, { width, height }: IDimensions): T