justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.7k stars 3.72k forks source link

faceapi.computeFaceDescriptor(alignedFaceImage) #726

Open my56 opened 4 years ago

my56 commented 4 years ago

In gitHub repo(https://github.com/justadudewhohacks/face-api.js) there is a below code to detect or compute face descriptor: const descriptor = await faceapi.computeFaceDescriptor(alignedFaceImage)

My question is HOW to get alignedFaceImage?? Please provide any resources for same to compute face descriptors of two images and match images.

josiahbryan commented 3 years ago

Did you check the demos? Literally just do face detection, get the face rectangle, and then grab the face (.getImageData or whatever from a canvas using that rectangle) and pass it to the compute function...very straightforward in the demo code