Comments (4)
Hi @MohannadBakkar !
If you simply want a small help, this is the approach I used :
- use opencv4nodejs to get a cv.rect that give you the position of a detected face in your webcam's frame
- enlarge this rect (it will be too small for face recognition otherwise).
- get a cropped image of your frame (to make recognition faster). Something like:
_croppedImage = _frame.getRegion(_enlargedRect);
# (you may need to add .resize(width, height)
- convert your image "from opencv4nodejs to face-recognition"
_frFaceImg = fr.cvImageToImageRGB(fr.CvImage(_croppedImage));
- recognize face
_faceResults = FaceRecognizer.predictBest(_frFaceImg);
As @justadudewhohacks pointed out in README, you could alternatively use face-api.js, which is newer, faster and more browser-friendly (but probably less "back-end friendly").
from face-recognition.js.
You welcome !
About face-api.js, I think you should consider give it a try. You will see it is really more efficient.
Even if it's clearly front-end oriented (at least when you look at example), you can also use it in back-end using tensors (from tensorflow).
You can find the code I used here to perform face detection on a webcam feed. (using opencv4nodejs to get webcam frames). You could easily add face recognition. Just do not forget to dispose your tensor, like I did !
from face-recognition.js.
@erenaud3 Thank you for your help.
also, I am actually not using any kind of front end, it's only back-end, that's why I didn't choose face-api.js.
from face-recognition.js.
What do you mean dispose of the tensor?
Now I'm facing a lot of lagging when I run the face recognizer on the webcam, I have 16 GB of ram btw.
from face-recognition.js.
Related Issues (20)
- npm install does not work HOT 2
- Face recognition not accurate with webcam
- can't use npm install face-recognition for auto build HOT 6
- "unresolved external symbol" on Manual build HOT 1
- TypeError: rawDescriptors.forEach is not a function
- How to add new faces and train it?
- npm install error HOT 3
- How can i write data on the image like you have write in example gif's?
- ERRO WHEN I TRY RUN NPM INSTALL FACE-RECOGNITION HOT 5
- ncaught Error: FaceRecognizer.constructor - expected inputs to be of type LabeledFaceDescriptors HOT 2
- CMake is pretending there is a "project(Project)" command on the first line. CMake Error in CMakeLists.txt: Generator Visual Studio 15 2017 Win64 could not find any instance of Visual Studio. HOT 3
- issue while install in windows
- \node_modules\face-recognition\cc\facerecognizernet.cc(82): note: No cons tructor could take the source type, or constructor overload resolution was ambiguous HOT 1
- Error: libdlib.so.19.8.0: cannot open shared object file: No such file or directory
- Identify faces looking little upside
- Installation rasp nicht möglich
- Installation issue on Linux
- window 10 installing error
- dataset & model trained on ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from face-recognition.js.