DefTruth / lite.ai.toolkit

🛠 A lite C++ toolkit of awesome AI models, support ONNXRuntime, MNN, TNN, NCNN and TensorRT.
https://github.com/DefTruth/lite.ai.toolkit
GNU General Public License v3.0
3.59k stars 684 forks source link

每个模型都要单独写类? #343

Closed geoexploring closed 2 years ago

geoexploring commented 2 years ago

请问为什么要为每个模型都单独写类呢?

在我的测试里,我把DeepLabV3ResNet101的模型换成BiSeNetV2依然能正常运行,所以是否只需要为每一个任务写一个通用类就可以呢?

感谢!

DefTruth commented 2 years ago

以前是这么干的。但后来模型多之后发现不太可能写通用类,因为你没办法限制模型的作者会对模型或前后处理做什么天马行空的改造

geoexploring commented 2 years ago

@DefTruth ,有道理。

谢谢!

geoexploring commented 2 years ago

@DefTruth ,对于语义分割模型,请问是否可以把所有后处理都写进ONNX模型里呢?这样模型部署时就能省事很多。

另外,请问大佬有没有遇见Python和C++预测结果不一致的情况?我发现转ONNX有两个坑:

谢谢!