Thanks to the official implementation of YOLOv7 https://github.com/WongKinYiu/yolov7
Thanks to the initial implementation of YOLOv7-face https://github.com/derronqi/yolov7-face
- python 3.9 or higher
- Ubuntu 18 or higher
- GPU: 3 x NVIDIA RTX 2080Ti GPUs
- CPU: 1 x intel core i9 9900K
- RAM: 128 GB Ram
Update
- 30/10: WiderFace dataset for yolov7-face: Google Drive
- 29/10: New annotation for YOLOv7 Face (Unofficial)
Raw dataset preparation WIDERFACE
Download both the WIDERFACE dataset and the landmarks annotation for yolov7. Then organize your stuffs following the structure below (Images are taken from WIDERFACE
while the equivalent .txt file can be found in yolov7-face-label
):
dataset
|-- WIDERFACE_retina
|---- train
|-------- image_name_abcxyz.jpg
|-------- image_name_abcxyz.txt
|---- val
|-------- image_name_abcxyz.jpg
|-------- image_name_abcxyz.txt
Dataset for official YOLOv5-v7 implementation
Unfortunately, the official WIDERFACE Dataset doesn't have landmarks information. However, landmarks annotation can be found at the repository of RetinaFace-Pytorch. After getting a heap of raw datasets, organize your stuffs following the structure below:
dataset
|-- WIDERFACE_retina
|---- train
|-------- images
|-------- label.txt
|---- val
|-------- images
|-------- label.txt
Note: The structure mentioned above is optional.
To create WIDERFACE dataset following YOLOv5-v7 style, just run
python preprocessing.py
Optional Argument:
--save_images
: (boolean) save images--root_dir
: (string) path to the WIDERFACE_retina dataset (default: dataset/WIDERFACE_retina)--write_landmark
: (boolean) save annotation having landmark information--saved_folder
: (boolean) path to the destination (default: dataset/WIDERFACE_yolov5)
You may have to install widerface python package via script:
pip install python-widerface
The methods of training model are refered from The offical Implementation of YOLOv7. An example of training is given in training_example.sh
file (GPU inference is required).
Model weight that achieve 81.45 AP on WiderFace validation hard set [VILOFACE]https://drive.google.com/file/d/19XlfTA9Yn6lo7XTujFeOsKJzXYRLuLza/view?usp=sharing