GithubHelp home page GithubHelp logo

rtmdet_snpe's Introduction

RTMDET在snpe部署

RTMDET: https://github.com/open-mmlab/mmdetection/tree/3.x/configs/rtmdet

RTMDET与其他算法的推理过程基本相同,主要在于HardSigmod算子SNPE不支持,并且这个算子比较简单,就借助snpe的udo自己实现了一下。这里主要记录snpe udo的使用过程。
官方文档:https://developer.qualcomm.com/sites/default/files/docs/snpe/usergroup2.html

REMDET

onnx模型下载路径:https://platform.openmmlab.com/deploee

  • 输入:1 * 640 * 640 * 3
  • 输出:1 * 300 * 5、 1 * 300 前一个输出表示检测框加置信度(xyxy+score),后一个则是标签

输出为300 * 5的原因是MMDeploy的模型已经集成了后处理,根据模型配置文件可以看到后处理保留了300个结果。如果使用 netron 直接查看转换前的onnx模型,可以看到原本模型的应该是动态输出,输出数是1*num_dets。
snpe不支持动态参数,所以在转换后变为了静态参数(在snpe1.68进行模型转换时,会直接报错,snpe2.10可以转换成功,会有Applying static reshape to 1239: new name 1241 new shape 的提示)。
将snpe推理的结果打印出来,发现前60个左右的推理结果都是完全一样的。猜测,可能是经过处理后的框不足300个,进行了补全。
p1
为了防止动态形状推理的问题,同时转换了另一个版本的rtmdet,不保留后处理部分。

  • 输入:1 * 640 * 640 * 3
  • 输出:1 * 8400 * 80、 1 * 8400 * 4

这样就比较好理解了,80表示coco的80类别,4是检测框。8400 = 6400 + 4600 + 400,表示RTMDET在三个尺度预测结果, 大小分别为 6400 (80 x 80)、1600 (40 x 40)、400 (20 x 20)。

udo定义

参考./snpe_udo/SNPEUDP.md。

rtmdet_snpe's People

Stargazers

yhwang avatar

Watchers

zli2_16 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.