Skip to content

RetinaFace with Gender and convert to openvino and tensorrt

Notifications You must be signed in to change notification settings

TalkUHulk/RetinaFace-with-Gender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RetinaFace with Gender


The demo of retinaface with gender.

Description

  • backbone: mobilenet-v2 | resnet50
  • datasets: widerface
  • addition: 在原始网络中加入性别判断,目前仅在resnet50中支持,cfg_re50.gender=True
  • tensorboard:

logs

  • FDDB ROC:

    ROC

  • demo:

    girls

    nba

    stars

Pretrained Models

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

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 🙏🙏🙏

About

RetinaFace with Gender and convert to openvino and tensorrt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published