The demo of retinaface with gender.
- backbone: mobilenet-v2 | resnet50
- datasets: widerface
- addition: 在原始网络中加入性别判断,目前仅在resnet50中支持,cfg_re50.gender=True
- tensorboard:
I provide all of the model to test. 链接: https://pan.baidu.com/s/1MYylkAeOW-5Uk3LnwdfgwA 密码: w8uw
Path | Description |
---|---|
torch | weight of pytorch |
onnx | weight of onnx |
openvino | weight of openvino |
tensorrt | weight of tensorrt |
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 |
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
python scripts/test_onnx.py \
--ckpt ./ckpt/onnx/retinaface-res50-gender-320.onnx \
--cfg config/res50_gender.yaml \
--images_path test_images \
--save results
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
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
This code is heavily based on Pytorch_Retinaface 🙏🙏🙏