# Face-Img-Filter
**Repository Path**: CV_Lab/face-img-filter
## Basic Information
- **Project Name**: Face-Img-Filter
- **Description**: 🚀基于YOLOv8的人脸图片过滤与管理工具
- **Primary Language**: Python
- **License**: AGPL-3.0
- **Default Branch**: master
- **Homepage**: https://gitee.com/PyCVer
- **GVP Project**: No
## Statistics
- **Stars**: 4
- **Forks**: 0
- **Created**: 2023-06-06
- **Last Updated**: 2024-01-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: 人脸检测, YOLOv8, 图片过滤, 人脸图片, 图片分类
## README
基于YOLOv8的人脸图片过滤与管理工具
## 🚀 作者简介
曾逸夫,从事人工智能研究与开发;主研领域:计算机视觉;[YOLOv8官方开源项目代码贡献人](https://github.com/ultralytics/ultralytics/graphs/contributors);[YOLOv5官方开源项目代码贡献人](https://github.com/ultralytics/yolov5/graphs/contributors)
❤️ Github:https://github.com/Zengyf-CVer
🚀更新走势
- `2023-10-09` **⚡ [Face Img Filter v0.1](https://gitee.com/CV_Lab/face-img-filter/releases/tag/v0.1)正式上线**
### 📌 项目整体流程
### 📌 项目示例
💡项目结构
```
.
├── Face-Img_Filter # 项目名称
│ ├── util # 工具包
│ │ ├── time_format.py # 时间格式化
│ │ ├── classify_parse.py # 分类解析
│ │ └── img_fix.py # 图片修复
│ ├── sample # 样本图片集
│ ├── face_img_filter.py # 主程序文件
│ ├── setup.cfg # pre-commit CI检查源配置文件
│ ├── .pre-commit-config.yaml # pre-commit配置文件
│ ├── LICENSE # 项目许可
│ ├── .gitignore # git忽略文件
│ ├── README.md # 项目说明
│ ├── yolov8_widerface.md # 基于yolov8的widerface人脸检测教程
│ ├── yolov8_classify.md # 基于yolov8的人脸属性分类教程
│ └── requirements.txt # 脚本依赖包
```
🔥安装教程
### ✅ 第一步:创建conda环境
```shell
conda create -n yolo python==3.9
conda activate yolo # 进入环境
```
### ✅ 第二步:克隆
```shell
git clone https://gitee.com/CV_Lab/face-img-filter.git
```
### ✅ 第三步:安装Face Img Filter依赖
```shell
cd face-img-filter
pip install -r ./requirements.txt -U
```
⚡使用教程
### 🔥 [基于WIDER FACE的YOLOv8人脸检测模型的构建](https://gitee.com/CV_Lab/face-img-filter/blob/master/yolov8_widerface.md)
❤️点击上方的链接,查看yolov8_widerface.md文件,关于基于WIDER FACE的YOLOv8人脸检测模型的构建过程
### 📌 人脸过滤
```shell
# 人脸过滤
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path
# 调节置信度阈值
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -cf 0.8
# 调节IoU阈值
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -iu 0.6
# 调节推理尺寸
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -is 320
# 更换人脸检测模型
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -fm ./custom_face_model.pt
```
### 🔥 [基于YOLOv8的人脸属性分类模型的构建](https://gitee.com/CV_Lab/face-img-filter/blob/master/yolov8_classify.md)
❤️点击上方的链接,查看yolov8_classify.md文件,关于基于YOLOv8的人脸属性分类模型的构建过程
### 📌 人脸性别属性过滤
```shell
# 性别过滤(默认为man)
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -gc -gn woman
# 更换人脸性别分类模型
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -gc -gn woman -gm ./face_gender_model.pt
{0: 'man', 1: 'woman'}
```
### 📌 人脸年龄属性过滤
```shell
# 年龄过滤(默认为Youth)
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -ac -an Teenagers
# 更换人脸年龄分类模型
python face_img_filter.py -ir ./origin_img_path -it ./target_img_path -ac -an Teenagers -am ./face_age_model.pt
{0: 'Children', 1: 'Elderly', 2: 'Infants', 3: 'Middle', 4: 'Teenagers', 5: 'Youth'}
```
#### ❤️ 项目`sample`目录提供图片样本,可以进行测试实验
### 💬 技术交流
- 如果你发现任何Face Img Filter存在的问题或者是建议, 欢迎通过[Gitee Issues](https://gitee.com/CV_Lab/face-img-filter/issues)给我提issues。
- 欢迎加入CV Lab技术交流群