# 说明
本仓库修改与仓库:[face_classification](https://github.com/oarriaga/face_classification/)
原仓库使用 OpenCV 进行人脸检测,但准确度不够高,因此后改用 [MTCNN](https://github.com/kpzhang93/MTCNN_face_detection_alignment) 增加检测准确率。
在原仓库中的改动如下:
+ 增加 MTCNN 模型: haarcascade_frontalface_default.xml
+ 增加人脸检测程序:detect_face.py
+ 更改程序 video_emotion_gender_demo.py, 使用 detect_face 来检测人脸。
下面是原始 README 内容:
---
# Face classification and detection from the [B-IT-BOTS robotics team](https://mas-group.inf.h-brs.de/?page_id=622).
Real-time face detection and emotion/gender classification using fer2013/IMDB datasets with a keras CNN model and openCV.
* IMDB gender classification test accuracy: 96%.
* fer2013 emotion classification test accuracy: 66%.
For more information please consult the [publication](https://github.com/oarriaga/face_classification/blob/master/report.pdf)
# Emotion/gender examples:
![alt tag](images/demo_results.png)
Guided back-prop
![alt tag](images/gradcam_results.png)
Real-time demo:
<div align='center'>
<img src='images/color_demo.gif' width='400px'>
</div>
[B-IT-BOTS](https://mas-group.inf.h-brs.de/?page_id=622) robotics team :)
![alt tag](images/robocup_team.png)
## Instructions
### Run real-time emotion demo:
> python3 video_emotion_color_demo.py
### Run real-time guided back-prop demo:
> python3 image_gradcam_demo.py
### Make inference on single images:
> python3 image_emotion_gender_demo.py <image_path>
e.g.
> python3 image_emotion_gender_demo.py ../images/test_image.jpg
### Running with Docker
With a few steps one can get its own face classification and detection running. Follow the commands below:
* ```docker pull ekholabs/face-classifier```
* ```docker run -d -p 8084:8084 --name=face-classifier ekholabs/face-classifier```
* ```curl -v -F image=@[path_to_image] http://localhost:8084/classifyImage > image.png```
### To train previous/new models for emotion classification:
* Download the fer2013.tar.gz file from [here](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data)
* Move the downloaded file to the datasets directory inside this repository.
* Untar the file:
> tar -xzf fer2013.tar
* Run the train_emotion_classification.py file
> python3 train_emotion_classifier.py
### To train previous/new models for gender classification:
* Download the imdb_crop.tar file from [here](https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/) (It's the 7GB button with the tittle Download faces only).
* Move the downloaded file to the datasets directory inside this repository.
* Untar the file:
> tar -xfv imdb_crop.tar
* Run the train_gender_classification.py file
> python3 train_gender_classifier.py
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
<项目介绍> 原仓库使用 OpenCV 进行人脸检测,但准确度不够高,因此后改用 MTCNN 增加检测准确率。 在原仓库中的改动如下: 增加 MTCNN 模型: haarcascade_frontalface_default.xml 增加人脸检测程序:detect_face.py 更改程序 video_emotion_gender_demo.py, 使用 - 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
资源推荐
资源详情
资源评论
收起资源包目录
emotion_recognition-master.zip (75个子文件)
emotion_recognition-master
report.pdf 958KB
src
__init__.py 0B
video_emotion_gender_demo.py 4KB
detect_face.py 31KB
image_gradcam_demo.py 3KB
utils
__init__.py 0B
preprocessor.py 642B
data_augmentation.py 10KB
inference.py 2KB
grad_cam.py 7KB
visualizer.py 6KB
datasets.py 6KB
web
__init__.py 1B
emotion_gender_processor.py 4KB
faces.py 1003B
train_gender_classifier.py 3KB
video_emotion_color_demo.py 3KB
video_dectect_emotion.py 4KB
video_gradcam_demo.py 3KB
train_emotion_classifier.py 3KB
image_emotion_gender_demo.py 3KB
models
__init__.py 0B
cnn.py 13KB
det3.npy 1.49MB
det2.npy 392KB
det1.npy 27KB
LICENSE 1KB
datasets
.gitignore 68B
REQUIREMENTS.txt 105B
trained_models
gender_models
simple_CNN.81-0.96.hdf5 7.35MB
gender_mini_XCEPTION.21-0.95.hdf5 784KB
emotion_models
fer2013_mini_XCEPTION.102-0.66.hdf5 852KB
simple_CNN.530-0.65.hdf5 7.47MB
fer2013_mini_XCEPTION.97-0.65.hdf5 852KB
fer2013_mini_XCEPTION.51-0.63.hdf5 852KB
fer2013_mini_XCEPTION.02-0.52.hdf5 852KB
simple_CNN.985-0.66.hdf5 7.47MB
fer2013_mini_XCEPTION.100-0.65.hdf5 852KB
fer2013_mini_XCEPTION.99-0.65.hdf5 852KB
fer2013_mini_XCEPTION.14-0.59.hdf5 852KB
fer2013_mini_XCEPTION.110-0.65.hdf5 852KB
fer2013_mini_XCEPTION.04-0.55.hdf5 852KB
fer2013_mini_XCEPTION.29-0.62.hdf5 852KB
fer2013_mini_XCEPTION.70-0.63.hdf5 852KB
fer2013_mini_XCEPTION.107-0.66.hdf5 852KB
mini_XCEPTION_KDEF.hdf5 852KB
fer2013_mini_XCEPTION.43-0.64.hdf5 852KB
tiny_XCEPTION_KDEF.hdf5 386KB
fer2013_mini_XCEPTION.37-0.62.hdf5 852KB
fer2013_mini_XCEPTION.00-0.47.hdf5 852KB
fer2013_mini_XCEPTION.25-0.60.hdf5 852KB
fer2013_mini_XCEPTION.27-0.62.hdf5 852KB
fer2013_mini_XCEPTION.10-0.58.hdf5 852KB
fer2013_mini_XCEPTION.32-0.62.hdf5 852KB
fer2013_mini_XCEPTION.05-0.56.hdf5 852KB
fer2013_mini_XCEPTION.12-0.58.hdf5 852KB
fer2013_mini_XCEPTION.41-0.62.hdf5 852KB
fer2013_mini_XCEPTION.38-0.62.hdf5 852KB
fer2013_mini_XCEPTION.03-0.53.hdf5 852KB
fer2013_mini_XCEPTION.15-0.60.hdf5 852KB
fer2013_mini_XCEPTION.11-0.58.hdf5 852KB
fer2013_mini_XCEPTION.08-0.57.hdf5 852KB
detection_models
haarcascade_frontalface_default.xml 908KB
fer2013_mini_XCEPTION.119-0.65.hdf5 848KB
fer2013_big_XCEPTION.54-0.66.hdf5 2.48MB
Dockerfile 532B
images
demo_results.png 723KB
color_demo.gif 26.62MB
gradcam_results.png 498KB
12_angry_men.jpg 134KB
robocup_team.png 3.62MB
emotion_classification.jpg 194KB
solvay_conference.jpg 133KB
test_image.jpg 503KB
README.md 3KB
共 75 条
- 1
资源评论
- 智能科学与技术学生2024-03-27大佬回我一下啊,我用不了
- 天恩小朋友2024-04-10这个资源内容超赞,对我来说很有价值,很实用,感谢大佬分享~
Android安卓科研室
- 粉丝: 1517
- 资源: 1165
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功