vladmandic / face-api

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
https://vladmandic.github.io/face-api/demo/webcam.html
MIT License
852 stars 153 forks source link

Migration to old face-api to @vladmandic/face-api #75

Closed amit0shakya closed 3 years ago

amit0shakya commented 3 years ago

I am using old face-api with React + NextJS, and it is running on nodev8 which raises many issues. I guess the old face-api consuming 100% clientside rom it didn't give any load to serverside. Do I impliment new @vladmandic/face-api in same manner. I want It didn't give load to server, If website traffic raise I don't need to worry about it.

vladmandic commented 3 years ago

Implementation is the same except there are per-target versions. It's all covered in docs, please check and report an issue if there is any.

amit0shakya commented 3 years ago

Actually my question is, if I implement @vladmandic/face-api, Is it consume node server RAM and CPU? Is there any way It will consume 100% clientside memory like old face-api without affecting server?.

vladmandic commented 3 years ago

It depends on your implementation - but done right, no it doesn't. Memory usage is really low.

Gussoft commented 3 years ago

Hi, I've been reviewing the project, it's very good! I have created an example of faceapi and uploaded it in a repo as an example, and I have noticed that in some mobiles it is very slow and as it consumes many resources in this case I tried it on a motorola e5 plus and it was not possible for me to run the example. How can I verify the minimum requirements to be able to consume this service without problems. Thank you https://webpagebigprime.s3.amazonaws.com/cam.htm

vladmandic commented 3 years ago

Any machine learning will be hard on compute - and E5 has a slow CPU/GPU. But at least try not to do it the wrong way - you have fixed setInterval which means that loop may try to start when previous one never even finished. Use requestAnimationFrame instead. And also, try with different backend.