deepinsight / deepinsight/insightface
Export insightface models to ONNX and inference with TensorRT
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone, here are some scripts that can convert insightface params to onnx model. These scripts have been sorted out various methods of exporting MXNet params or insightface params on the GitHub or CSDN, and can export various models of insightface, **RetinaFace**, **arcface**, **2d106det** and **gender-age** models are all supported. The repo address is: [https://github.com/linghu8812/tensorrt_inference](https://github.com/linghu8812/tensorrt_inference)
supported models|scripts
---|---
RetinaFace|[export_retinaface](https://github.com/linghu8812/tensorrt_inference/blob/master/project/RetinaFace/export_onnx.py)
arcface|[export_arcface](https://github.com/linghu8812/tensorrt_inference/blob/master/project/arcface/export_onnx.py)
2d106det|[export_2d106det](https://github.com/linghu8812/tensorrt_inference/blob/master/project/face_alignment/export_onnx.py)
gender-age|[export_gender-age](https://github.com/linghu8812/tensorrt_inference/blob/master/project/gender-age/export_onnx.py)
### Export RetinaFace params to ONNX
For RetinaFace model, RetinaFace-R50, RetinaFace-MobileNet0.25 and RetinaFaceAntiCov are both supported. copy [project/RetinaFace/export_onnx.py](https://github.com/linghu8812/tensorrt_inference/blob/master/project/RetinaFace/export_onnx.py) to `./detection/RetinaFace` or `./detection/RetinaFaceAntiCov`, with the following comman can export those models.
- export resnet50 model
```
python3 export_onnx.py
```
- export mobilenet 0.25 model
```
python3 export_onnx.py --prefix ./model/mnet.25
```
- export RetinaFaceAntiCov model
```
python3 export_onnx.py --prefix ./model/mnet_cov2 --network net3l
```
An inference code with tensorrt has also been supplied, the following are inference results:
- RetinaFace-R50 result

- RetinaFaceAntiCov result

### Export arcface params to ONNX
For arcface model, it has added reshape the shape of PRelu params, so the exported PRelu node structure is shown as following:

### Export gender-age and 2d106det params to ONNX
The following is a TensorRT result for 2d106det model, now it's run alone, not with retinaface

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.