面部表情识别(Pytorch):人脸检测模型+面部表情识别分类模型

0 相关资料

面部表情识别2:Pytorch实现表情识别(含表情识别数据集和训练代码):https://blog.csdn.net/guyuealian/article/details/129505205

b站视频:https://www.bilibili.com/video/BV1xm4y1p7H3

1 基于人脸检测+面部表情分类识别方法

项目源码:https://github.com/Whiffe/PyTorch-Facial-Expression-Recognition

面部表情识别由两部分组成:人脸检测与表情识别分类

人脸检测:https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB

表情识别分类: resnet18,resnet34,resnet50, mobilenet_v2以及googlenet等常见的深度学习模型

2 项目安装

2.1 平台与镜像

我是实用的AutoDL平台

镜像选择:
PyTorch 1.7.0
Python 3.8(ubuntu18.04)
Cuda 11.0
在这里插入图片描述

2.2 项目下载

项目下载:

扫描二维码关注公众号,回复: 16438368 查看本文章
git clone https://github.com/Whiffe/PyTorch-Facial-Expression-Recognition.git

如果网速问题无法下载,我已经同步到码云上(推荐)

git clone https://gitee.com/YFwinston/PyTorch-Facial-Expression-Recognition.git

2.3 模型下载

模型权重下载(latest-model-099-94.7200.pth):https://download.csdn.net/download/WhiffeYF/88196455
将下载的模型放在:
PyTorch-Facial-Expression-Recognition/data/pretrained/mobilenet_v2_1.0_CrossEntropyLoss_20230313090258/model
在这里插入图片描述

模型权重下载(rfb-face-mask.pth): https://download.csdn.net/download/WhiffeYF/88196487
将下载的模型放在:
PyTorch-Facial-Expression-Recognition/libs/light_detector/data/pretrained/pth
在这里插入图片描述

2.4 上传待测试图片

在该目录下,上传待检测图片:
PyTorch-Facial-Expression-Recognition/data/test_image

在这里插入图片描述

2.5 项目安装

在 PyTorch-Facial-Expression-Recognition 目录下执行:

pip install -r requirements.txt 

3 demo测试

python demo.py --image_dir data/test_image --model_file data/pretrained/mobilenet_v2_1.0_CrossEntropyLoss_20230313090258/model/latest_model_099_94.7200.pth --out_dir output/

在这里插入图片描述

在这里插入图片描述
检测结果如下:
在这里插入图片描述
在这里插入图片描述

v
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/WhiffeYF/article/details/132188897