# FerInClass **Repository Path**: sudo_root/fer-in-class ## Basic Information - **Project Name**: FerInClass - **Description**: 论文中使用的Python脚本,人脸检测代码(基于yolov5),表情识别代码(自定义表情4种) - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2023-04-02 - **Last Updated**: 2025-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FerInClass #### 介绍 论文中使用的Python脚本,人脸检测代码(基于yolov5),表情识别代码(自定义表情4种)。 实验的硬件平台是AMD-CPU 3700x,内存为64GB,显卡为nVidia Geforce 3060ti-8GB,软件平台是Windows系统,Python 3.10,tensorflow2,cuda11.8等。 #### 内容说明 文件分类说明。 文中的代码分为脚本和人脸检测识别、表情识别两部分。 #### 使用前提 1. Python 3.10.10#首先安装Python环境 2. ```python pip config set global.index-url https://mirror.lzu.edu.cn/pypi/web/simple #修改pypip源为兰州大学源 python.exe -m pip install --upgrade pip #更新pip pip install setuptools wheel #安装setuptools wheel pip install gitpython ipython matplotlib numpy opencv-python Pillow #安装第一部分运行所需库 psutil PyYAML requests scipy thop tqdm pandas seaborn #安装第二部分运行所需库 pip install tensorflow #安装 tensorflow pip install Torch #如果需要cuda支持,请使用 pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 并根据CUDA的要求列表将cuda下载安装,再下载cudnn等文件配置齐全。 ``` 3. 下载代码,使用以下命令开始训练: ```python python train.py --data fer.yaml --weights yolov5s.pt --img 640 #fer.yaml是自己根据自定义数据集配置的文件 ``` 若不训练,则直接使用: ```python python d2exps.py --weights fer.pt # fer.pt是自己训练的权重 ``` 进行检测,参数在代码中已经用注释表明,使用前根据环境不同改进即可。 #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)