wwfacedet

This repository is used for exploratory experiments of yunet face detection. It will eventually be merged into repository libfacedetection.train

https://github.com/wwupup/wwfacedet

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: ieee.org
  • Committers with academic emails
    16 of 336 committers (4.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.1%) to scientific vocabulary

Keywords from Contributors

beit clip constrastive-learning convnext mae masked-image-modeling mobilenet moco multimodal pretrained-models
Last synced: 6 months ago · JSON representation ·

Repository

This repository is used for exploratory experiments of yunet face detection. It will eventually be merged into repository libfacedetection.train

Basic Info
  • Host: GitHub
  • Owner: Wwupup
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 131 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed about 3 years ago
Metadata Files
Readme License Citation

README.md

Training for libfacedetection in PyTorch

License

It is the training program for libfacedetection. The source code is based on MMDetection. Some data processing functions from SCRFD modifications.

Visualization of our network architecture: [netron].

Contents

Installation

  1. Install PyTorch >= v1.7.0 following official instruction. e.g.\ On GPU platforms (cu102):\ shell conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.2 -c pytorch
  2. Install MMCV >= v1.3.17 following official instruction. e.g.\ shell pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.7.0/index.html
  3. Clone this repository. We will call the cloned directory as $TRAIN_ROOT. Shell git clone https://github.com/Wwupup/wwfacedet cd wwfacedet python setup.py develop
  4. Install dependencies. shell pip install -r requirements.txt

Note: Codes are based on Python 3+.

Preparation

  1. Download the WIDER Face dataset and its evaluation tools.
  2. Extract zip files under $TRAIN_ROOT/data/widerface as follows: shell $ tree data/widerface data/widerface ├── wider_face_split ├── WIDER_test ├── WIDER_train ├── WIDER_val └── labelv2 ├── train │ └── labelv2.txt └── val ├── gt └── labelv2.txt

Training

Following MMdetection training processing.

Shell CUDA_VISIBLE_DEVICES=0,1 bash tools/dist_train.sh ./config/yunet/x.py 2

Detection

Shell python tools/detect-image.py ./config/x.py ./work_dirs/x/latest.pth ./image.jpg

Evaluation on WIDER Face

shell python tools/test_widerface.py ./config/x.py ./work_dirs/x/latest.pth --mode 2

Performance on WIDER Face (Val): confidencethreshold=0.02, nmsthreshold=0.45, in origin size:

AP_easy=0.899, AP_medium=0.883, AP_hard=0.792

Export CPP source code

The following bash code can export a CPP file for project libfacedetection

Shell python tools/export2cpp.py ./config/x.py ./work_dirs/x/latest.pth

Export to onnx model

Export to onnx model for libfacedetection/example/opencv_dnn.

shell python tools/wwdet2onnx.py ./config/x.py ./work_dirs/x/latest.pth

Compare ONNX model with other works

Inference on exported ONNX models using ONNXRuntime:

shell python tools/compare_inference.py ./onnx/wwdet.onnx --mode AUTO --eval --score_thresh 0.02 --nms_thresh 0.45

Some similar approaches(e.g. SCRFD, Yolo5face, retinaface) to inference are also supported.

With Intel i7-12700K and input_size = origin size, score_thresh = 0.3, nms_thresh = 0.45, some results are list as follow:

| Model | APeasy | APmedium | AP_hard | #Params | Params Ratio | MFlops | Forward (ms) | | ----------------------- | ------- | --------- | ------- | ------- | ------------ | ------ | ------------ | | SCRFD0.5(ICLR2022) | 0.879 | 0.863 | 0.759 | 631410 | 7.43x | 184 | 22.3 | | Retinaface0.5(CVPR2020) | 0.899 | 0.866 | 0.660 | 426608 | 5.02X | 245 | 13.9 | | YuNet(Ours) | 0.885 | 0.877 | 0.762 | 85006 | 1.0x | 136 | 10.6 |

The compared ONNX model is available in https://share.weiyun.com/nEsVgJ2v Password:gydjjs

Citation

The loss used in training is EIoU, a novel extended IoU. More details can be found in:

@article{eiou, author={Peng, Hanyang and Yu, Shiqi}, journal={IEEE Transactions on Image Processing}, title={A Systematic IoU-Related Method: Beyond Simplified Regression for Better Localization}, year={2021}, volume={30}, pages={5032-5044}, doi={10.1109/TIP.2021.3077144} }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9429909.

We also published a paper on face detection to evaluate different methods.

@article{facedetect-yu, author={Yuantao Feng and Shiqi Yu and Hanyang Peng and Yan-ran Li and Jianguo Zhang} title={Detect Faces Efficiently: A Survey and Evaluations}, journal={IEEE Transactions on Biometrics, Behavior, and Identity Science}, year={2021} }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9580485

Owner

  • Login: Wwupup
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - name: "MMDetection Contributors"
title: "OpenMMLab Detection Toolbox and Benchmark"
date-released: 2018-08-22
url: "https://github.com/open-mmlab/mmdetection"
license: Apache-2.0

GitHub Events

Total
Last Year

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,944
  • Total Committers: 336
  • Avg Commits per committer: 5.786
  • Development Distribution Score (DDS): 0.841
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Kai Chen c****v@g****m 310
Wenwei Zhang 4****e 180
Cao Yuhang y****6@g****m 156
Haian Huang(深度眸) 1****9@q****m 130
Jerry Jiarui XU x****6@g****m 109
Wwupup w****f@q****m 57
Shilong Zhang 6****g 56
RangiLyu l****i@g****m 54
pangjm p****u@g****m 49
Guangchen Lin 3****0@q****m 40
BigDong y****g@t****n 37
ThangVu t****k@g****m 32
Jiaqi Wang 1****0@l****k 30
Wang Xinjiang w****g@s****m 29
Cedric Luo l****6@o****m 28
Qiaofei Li q****i@g****m 22
Jon Crall e****c@g****m 21
Czm369 4****9 20
Yosuke Shinya 4****y 19
RunningLeon m****g@s****m 15
jbwang1997 j****7@g****m 15
tianyuandu t****u@g****m 13
David de la Iglesia Castro d****o@g****m 11
Ryan Li x****e@c****k 10
Maxim Bonnaerens m****m@b****e 9
Kamran Melikov m****k@g****m 9
Yue Zhou 5****9@q****m 9
yuzhj 3****j 8
simon wu w****y@s****m 8
GT9505 g****3@g****m 7
and 306 more...

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements/build.txt pypi
  • cython *
  • numpy *
requirements/optional.txt pypi
  • cityscapesscripts *
  • imagecorruptions *
  • scipy *
  • sklearn *
  • timm *
requirements/runtime.txt pypi
  • matplotlib *
  • numpy *
  • pycocotools *
  • six *
  • terminaltables *
requirements/tests.txt pypi
  • asynctest * test
  • codecov * test
  • flake8 * test
  • interrogate * test
  • isort ==4.3.21 test
  • kwarray * test
  • onnx ==1.7.0 test
  • onnxruntime >=1.8.0 test
  • pytest * test
  • ubelt * test
  • xdoctest >=0.10.0 test
  • yapf * test