1 Star 0 Fork 261

liyongchao992 / PaddleDetection

forked from PaddlePaddle / PaddleDetection 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 3.84 KB
一键复制 编辑 原始数据 按行查看 历史
wangguanzhong 提交于 2021-04-16 11:26 . fix ttfhead & doc link (#2653)

人脸检测模型

简介

face_detection中提供高效、高速的人脸检测解决方案,包括最先进的模型和经典模型。

模型库

WIDER-FACE数据集上的mAP

网络结构 输入尺寸 图片个数/GPU 学习率策略 Easy/Medium/Hard Set 预测时延(SD855) 模型大小(MB) 下载 配置文件
BlazeFace 640 8 1000e 0.885 / 0.855 / 0.731 - 0.472 下载链接 配置文件

注意:

快速开始

数据准备

我们使用WIDER-FACE数据集进行训练和模型测试,官方网站提供了详细的数据介绍。

  • WIDER-Face数据源:
    使用如下目录结构加载wider_face类型的数据集:

    dataset/wider_face/
    ├── wider_face_split
    │   ├── wider_face_train_bbx_gt.txt
    │   ├── wider_face_val_bbx_gt.txt
    ├── WIDER_train
    │   ├── images
    │   │   ├── 0--Parade
    │   │   │   ├── 0_Parade_marchingband_1_100.jpg
    │   │   │   ├── 0_Parade_marchingband_1_381.jpg
    │   │   │   │   ...
    │   │   ├── 10--People_Marching
    │   │   │   ...
    ├── WIDER_val
    │   ├── images
    │   │   ├── 0--Parade
    │   │   │   ├── 0_Parade_marchingband_1_1004.jpg
    │   │   │   ├── 0_Parade_marchingband_1_1045.jpg
    │   │   │   │   ...
    │   │   ├── 10--People_Marching
    │   │   │   ...
  • 手动下载数据集: 要下载WIDER-FACE数据集,请运行以下命令:

cd dataset/wider_face && ./download_wider_face.sh

训练与评估

训练流程与评估流程方法与其他算法一致,请参考GETTING_STARTED_cn.md
注意: 人脸检测模型目前不支持边训练边评估。

在WIDER-FACE数据集上评估

  • 步骤一:评估并生成结果文件:
python -u tools/eval.py -c configs/face_detection/blazeface_1000e.yml \
       -o weights=output/blazeface_1000e/model_final \
       multi_scale=True

设置multi_scale=True进行多尺度评估,评估完成后,将在output/pred中生成txt格式的测试结果。

  • 步骤二:下载官方评估脚本和Ground Truth文件:
wget http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/support/eval_script/eval_tools.zip
unzip eval_tools.zip && rm -f eval_tools.zip
  • 步骤三:开始评估

方法一:python评估:

git clone https://github.com/wondervictor/WiderFace-Evaluation.git
cd WiderFace-Evaluation
# 编译
python3 setup.py build_ext --inplace
# 开始评估
python3 evaluation.py -p /path/to/PaddleDetection/output/pred -g /path/to/eval_tools/ground_truth

方法二:MatLab评估:

# 在`eval_tools/wider_eval.m`中修改保存结果路径和绘制曲线的名称:
pred_dir = './pred';  
legend_name = 'Paddle-BlazeFace';

`wider_eval.m` 是评估模块的主要执行程序。运行命令如下:
matlab -nodesktop -nosplash -nojvm -r "run wider_eval.m;quit;"

Citations

@article{bazarevsky2019blazeface,
      title={BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs},
      author={Valentin Bazarevsky and Yury Kartynnik and Andrey Vakunov and Karthik Raveendran and Matthias Grundmann},
      year={2019},
      eprint={1907.05047},
      archivePrefix={arXiv},
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/liyongchao992/PaddleDetection.git
git@gitee.com:liyongchao992/PaddleDetection.git
liyongchao992
PaddleDetection
PaddleDetection
release/2.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891