All Projects → XUranus → face2u

XUranus / face2u

Licence: other
keras cnn和face-api.js实现的人脸识别与情绪分类

Programming Languages

Jupyter Notebook
11667 projects
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to face2u

Facial-Recognition-Attendance-System
An attendance system which uses facial recognition to detect which people are present in any image.
Stars: ✭ 48 (+182.35%)
Mutual labels:  face-api
insight-face-paddle
End-to-end face detection and recognition system using PaddlePaddle.
Stars: ✭ 52 (+205.88%)
Mutual labels:  face-api
enjoytheshow
Real-time facial expression gathering
Stars: ✭ 32 (+88.24%)
Mutual labels:  face-api
Cognitive-Face-Xamarin
A client library that makes it easy to work with the Microsoft Cognitive Services Face API on Xamarin.iOS, Xamarin.Android, and Xamarin.Forms and/or Portable Class Libraries.
Stars: ✭ 18 (+5.88%)
Mutual labels:  face-api
Tenginekit
TengineKit - Free, Fast, Easy, Real-Time Face Detection & Face Landmarks & Face Attributes & Hand Detection & Hand Landmarks & Body Detection & Body Landmarks & Iris Landmarks & Yolov5 SDK On Mobile.
Stars: ✭ 2,103 (+12270.59%)
Mutual labels:  face-api

人脸识别 表情分类

使用webcam识别人脸和情绪分类

模型训练

使用keras训练,三层卷积 + 一层全连接 + Softmax,训练过程见kaggle-emotion.ipynb,数据来自kaggle比赛数据集fer2013

  • 前端:React + face-api.js
  • 后端:Flask + Keras

人脸Box位置检测使用了face-api.js的库,用canvas截取100×100的人脸图片,转化成RGBA数组,压缩灰化,交由分类器返回分类数据。

构建与部署

默认使用LocalMode:前端内置了tensorflow.js,可以直接加载训练好的模型,脱离后端独立运行:

cd ui
yarn install && yarn start

浏览器访问http://localhost:3000即可直接体验。

训练好的HDF5格式的模型文件位于/server/emotion_model.h5,其中前端/ui/public/model下的文件是由其用tensorflowjs_converter转化而来的。

不使用LocalMode时,即需要额外配置/ui/src/CameraSection.js中的Flask服务器地址serverAddr,以及server/server.py中的Flask服务器地址和端口号,后端依赖安装:cd server && pip3 install -r requirements.txt,最后python3 server.py启动后端服务器。

由于最新的chrome已经禁止了不安全的连接开启userMedia,必须要用https或者在localhost下访问,否则webcam无法使用

效果

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].