1 Star 0 Fork 36

myForker/FastDeploy

forked from PaddlePaddle/FastDeploy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
benchmark
c_api
cmake
cpack
csharp
docs
examples
application
audio
multimodal/stable_diffusion
runtime
text
vision
classification
detection
facealign
facedet
blazeface
centerface
retinaface
cpp
python
README.md
README_CN.md
scrfd
ultraface
yolov5face
yolov7face
README.md
README_CN.md
faceid
generation/anemigan
headpose
keypointdetection
matting
ocr/PP-OCR
perception/paddle3d
segmentation/paddleseg
sr
tracking/pptracking
README.md
README_CN.md
CMakeLists.txt
fastdeploy
java/android
paddle2onnx
poros
python
scripts
serving
streamer
tests
third_party
tools
tutorials
.clang-format
.clang_format.hook
.cpplint_pre_commit.hook
.gitignore
.pre-commit-config.yaml
CMakeLists.txt
CODE_OF_CONDUCT.md
FastDeploy.cmake.in
FastDeployCSharp.cmake.in
LICENSE
README.md
README_CN.md
README_EN.md
ThirdPartyNotices.txt
VERSION_NUMBER
commit-prepare.sh
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

English | 简体中文

RetinaFace准备部署模型

导出ONNX模型

下载预训练ONNX模型已事先转换成ONNX;如果从RetinaFace官方repo下载的模型,需要按如下教程导出ONNX。

  • 下载官方仓库并
git clone https://github.com/biubug6/Pytorch_Retinaface.git
  • 下载预训练权重并放在weights文件夹
./weights/
      mobilenet0.25_Final.pth
      mobilenetV1X0.25_pretrain.tar
      Resnet50_Final.pth
  • 运行convert_to_onnx.py导出ONNX模型文件
PYTHONPATH=. python convert_to_onnx.py --trained_model ./weights/mobilenet0.25_Final.pth --network mobile0.25 --long_side 640 --cpu
PYTHONPATH=. python convert_to_onnx.py --trained_model ./weights/Resnet50_Final.pth --network resnet50 --long_side 640 --cpu

注意:需要先对convert_to_onnx.py脚本中的--long_side参数增加类型约束,type=int.

  • 使用onnxsim对模型进行简化
onnxsim FaceDetector.onnx Pytorch_RetinaFace_mobile0.25-640-640.onnx  # mobilenet
onnxsim FaceDetector.onnx Pytorch_RetinaFace_resnet50-640-640.onnx  # resnet50

下载预训练ONNX模型

为了方便开发者的测试,下面提供了RetinaFace导出的各系列模型,开发者可直接下载使用。(下表中模型的精度来源于源官方库)

模型 大小 精度
RetinaFace_mobile0.25-640 1.7MB -
RetinaFace_mobile0.25-720 1.7MB -
RetinaFace_resnet50-640 105MB -
RetinaFace_resnet50-720 105MB -

详细部署文档

版本说明

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/encv/FastDeploy.git
git@gitee.com:encv/FastDeploy.git
encv
FastDeploy
FastDeploy
develop

搜索帮助