https://github.com/talkuhulk/retinaface-with-gender
RetinaFace with Gender and convert to openvino and tensorrt
https://github.com/talkuhulk/retinaface-with-gender
face-detection openvino pytorch retinaface tensorrt
Last synced: 3 months ago
JSON representation
RetinaFace with Gender and convert to openvino and tensorrt
- Host: GitHub
- URL: https://github.com/talkuhulk/retinaface-with-gender
- Owner: TalkUHulk
- Created: 2021-08-22T10:43:15.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-22T10:54:19.000Z (about 4 years ago)
- Last Synced: 2025-04-28T08:43:47.431Z (6 months ago)
- Topics: face-detection, openvino, pytorch, retinaface, tensorrt
- Language: Python
- Homepage:
- Size: 7.92 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
The demo of retinaface with gender.## Description
- **backbone**: *mobilenet-v2 | resnet50*
- **datasets**: *widerface*
- **addition**: *在原始网络中加入性别判断,目前仅在resnet50中支持,*[cfg_re50.gender=True](./data/config.py)
- **tensorboard**:
- **FDDB ROC**:
- **demo**:


## Pretrained Models
I provide all of the model to test.
链接: https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA 密码: w8uw| Path | Description
| :--- | :----------
|[torch](https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA) | weight of pytorch
|[onnx](https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA) | weight of onnx
|[openvino](https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA) | weight of openvino
|[tensorrt](https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA) | weight of tensorrt## Comparison
*All test on ubuntu 18.04 | 8 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz | GeForce GTX 1060 6G***Resnet50 with Gender**
|Name|Time(s)|
|:---|:--|
|torch gpu|0.0159|
|torch cpu|0.1233|
|onnx|0.0661|
|openvino|0.0595|
|tensorrt|0.0084|**MobileNetV2**
|Name|Time(s)|
|:---|:--|
|torch gpu|0.0106|
|torch cpu|0.0522|
|onnx|0.0192|
|openvino|0.0166|
|tensorrt|0.0030|## Test
### torch
```
python scripts/test_images.py \
--ckpt ./ckpt/torch/Resnet50_Gender_Final.pth \
--cfg config/res50_gender.yaml \
--device cpu \
--images_path test_images \
--save results
```### onnx
```
python scripts/test_onnx.py \
--ckpt ./ckpt/onnx/retinaface-res50-gender-320.onnx \
--cfg config/res50_gender.yaml \
--images_path test_images \
--save results
```### openvino
```
python scripts/test_openvino.py \
--xml ./ckpt/openvino/res50/retinaface-res50-gender-320.xml \
--bin ./ckpt/openvino/res50/retinaface-res50-gender-320.bin \
--cfg config/res50_gender.yaml \
--images_path test_images \
--save results
```### tensorrt
recommend use docker:
```
docker pull nvcr.io/nvidia/pytorch:20.09-py3
```
then:
```
docker run -it --rm --runtime nvidia --network host -v $PWD:/home --name tensorrt nvcr.io/nvidia/pytorch:20.09-py3
```
run:
```
python scripts/test_tensorrt.py \
--ckpt ./ckpt/tensorrt/Resnet50_Gender_Final_Trt.pth \
--cfg config/res50_gender.yaml \
--images_path test_images \
--save results
```## Citation
This code is heavily based on [Pytorch_Retinaface](https://github.com/biubug6/Pytorch_Retinaface) 🙏🙏🙏