Home

Awesome

What's New

2024.04 ncnn-android-yolov8-face

2023.04 yolov8-face (🔥🔥🔥↑)

2022.10 yolov7-face (🔥🔥🔥↑)

2022.8: yolov7

MethodTest SizeEasyMediumHardFLOPs (B) @640
yolov7-lite-t64088.785.271.50.8
yolov7-lite-s64092.789.978.53.0
yolov7-tiny64094.792.682.113.2
yolov7s64094.893.185.216.8
yolov764096.995.588.0103.4
yolov7+TTA64097.295.887.7103.4

2021.12: Yolov5-face to TensorRT.

BackbonePytorch(ms)TensorRT_FP16(ms)
yolov5n-0.57.72.1
yolov5n-face7.72.4
yolov5s-face5.62.2
yolov5m-face9.93.3
yolov5l-face15.94.5

Pytorch=1.10.0+cu102 TensorRT=8.2.0.6 Hardware=rtx2080ti

2021.11: BlazeFace

Methodmulti scaleEasyMediumHardModel Size(MB)Link
BlazeFaceTure88.585.573.10.472https://github.com/PaddlePaddle/PaddleDetection
BlazeFace-FPN-SSHTure90.788.379.30.479https://github.com/PaddlePaddle/PaddleDetection
yolov5-blazefaceTrue90.488.778.00.493https://pan.baidu.com/s/1RHp8wa615OuDVhsO-qrMpQ pwd:r3v3 https://drive.google.com/file/d/1adi6ke2vCLQFcpbvFqWo_J4wZIfPqSMG
yolov5-blazeface-fpnTrue90.889.479.10.493-

2021.08: Add new training dataset Multi-Task-Facial,improve large face detection.

MethodEasyMediumHard
YOLOv5s94.5692.9283.84
YOLOv5m95.4693.8785.54

QQ Group: 1164802745

Introduction

Yolov5-face is a real-time,high accuracy face detection.

Performance

Single Scale Inference on VGA resolution(max side is equal to 640 and scale).

Large family

MethodBackboneEasyMediumHard#Params(M)#Flops(G)
DSFD (CVPR19)ResNet15294.2991.4771.39120.06259.55
RetinaFace (CVPR20)ResNet5094.9291.9064.1729.5037.59
HAMBox (CVPR20)ResNet5095.2793.7676.7530.2443.28
TinaFace (Arxiv20)ResNet5095.6194.2581.4337.98172.95
SCRFD-34GF(Arxiv21)Bottleneck Res96.0694.9285.299.8034.13
SCRFD-10GF(Arxiv21)Basic Res95.1693.8783.053.869.98
-------
YOLOv5sCSPNet94.6792.7583.037.0755.751
YOLOv5s6CSPNet95.4893.6682.812.3866.280
YOLOv5mCSPNet95.3093.7685.2821.06318.146
YOLOv5m6CSPNet95.6694.185.235.48519.773
YOLOv5lCSPNet95.7894.3086.1346.62741.607
YOLOv5l6CSPNet96.3894.9085.8876.67445.279

Small family

MethodBackboneEasyMediumHard#Params(M)#Flops(G)
RetinaFace (CVPR20MobileNet0.2587.7881.1647.320.440.802
FaceBoxes (IJCB17)76.1757.1724.181.010.275
SCRFD-0.5GF(Arxiv21)Depth-wise Conv90.5788.1268.510.570.508
SCRFD-2.5GF(Arxiv21)Basic Res93.7892.1677.870.672.53
-------
YOLOv5nShuffleNetv293.7491.5480.321.7262.111
YOLOv5n-0.5ShuffleNetv290.7688.1273.820.4470.571

Pretrained-Models

NameEasyMediumHardFLOPs(G)Params(M)Link
yolov5n-0.590.7688.1273.820.5710.447Link: https://pan.baidu.com/s/1UgiKwzFq5NXI2y-Zui1kiA pwd: s5ow, https://drive.google.com/file/d/1XJ8w55Y9Po7Y5WP4X1Kg1a77ok2tL_KY/view?usp=sharing
yolov5n93.6191.5280.532.1111.726Link: https://pan.baidu.com/s/1xsYns6cyB84aPDgXB7sNDQ pwd: lw9j,https://drive.google.com/file/d/18oenL6tjFkdR1f5IgpYeQfDFqU4w3jEr/view?usp=sharing
yolov5s94.3392.6183.155.7517.075Link: https://pan.baidu.com/s/1fyzLxZYx7Ja1_PCIWRhxbw Link: eq0q,https://drive.google.com/file/d/1zxaHeLDyID9YU4-hqK7KNepXIwbTkRIO/view?usp=sharing
yolov5m95.3093.7685.2818.14621.063Link: https://pan.baidu.com/s/1oePvd2K6R4-gT0g7EERmdQ pwd: jmtk, https://drive.google.com/file/d/1Sx-KEGXSxvPMS35JhzQKeRBiqC98VDDI
yolov5l95.7894.3086.1341.60746.627Link: https://pan.baidu.com/s/11l4qSEgA2-c7e8lpRt8iFw pwd: 0mq7, https://drive.google.com/file/d/16F-3AjdQBn9p3nMhStUxfDNAE_1bOF_r

Data preparation

  1. Download WIDERFace datasets.
  2. Download annotation files from google drive.
cd data
python3 train2yolo.py /path/to/original/widerface/train [/path/to/save/widerface/train]
python3 val2yolo.py  /path/to/original/widerface [/path/to/save/widerface/val]

Training

CUDA_VISIBLE_DEVICES="0,1,2,3" python3 train.py --data data/widerface.yaml --cfg models/yolov5s.yaml --weights 'pretrained models'

WIDERFace Evaluation

python3 test_widerface.py --weights 'your test model' --img-size 640

cd widerface_evaluate
python3 evaluation.py

Test

Landmark Visulization

First row: RetinaFace, 2nd row: YOLOv5m-Face YOLO5Face was used in the 3rd place standard face recogntion track of the ICCV2021 Masked Face Recognition Challenge.

AXera demo

https://github.com/AXERA-TECH/ax-samples/blob/main/examples/ax_yolov5s_face_steps.cc

Android demo

https://github.com/FeiGeChuanShu/ncnn_Android_face/tree/main/ncnn-android-yolov5_face

OpenCV DNN demo

https://github.com/hpc203/yolov5-face-landmarks-opencv-v2

ONNXRuntime/MNN/TNN/NCNN C++ demo

https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/ort/cv/yolo5face.cpp

https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/mnn/cv/mnn_yolo5face.cpp

https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/tnn/cv/tnn_yolo5face.cpp

https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/ncnn/cv/ncnn_yolo5face.cpp

References

https://github.com/ultralytics/yolov5

https://github.com/DayBreak-u/yolo-face-with-landmark

https://github.com/xialuxi/yolov5_face_landmark

https://github.com/biubug6/Pytorch_Retinaface

https://github.com/deepinsight/insightface

Citation