[RKNPU2] Update quantitative model (#879)

* 对RKNPU2后端进行修改,当模型为非量化模型时,不在NPU执行normalize操作,当模型为量化模型时,在NUP上执行normalize操作

* 更新RKNPU2框架,输出数据的数据类型统一返回fp32类型

* 更新scrfd,拆分disable_normalize和disable_permute

* 更新scrfd代码,支持量化

* 更新scrfd python example代码

* 更新模型转换代码,支持量化模型

* 更新文档

* 按照要求修改

* 按照要求修改

* 修正模型转换文档

* 更新一下转换脚本
This commit is contained in:
Zheng_Bicheng
2022-12-19 13:58:43 +08:00
committed by GitHub
parent 383887dede
commit dc13eb7049
18 changed files with 92 additions and 148 deletions

View File

@@ -29,6 +29,7 @@ void ONNXInfer(const std::string& model_dir, const std::string& image_file) {
tc.End();
tc.PrintInfo("SCRFD in ONNX");
std::cout << res.Str() << std::endl;
cv::imwrite("infer_onnx.jpg", vis_im);
std::cout
<< "Visualized result saved in ./infer_onnx.jpg"
@@ -48,7 +49,8 @@ void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) {
std::cerr << "Failed to initialize." << std::endl;
return;
}
model.DisableNormalizeAndPermute();
model.DisableNormalize();
model.DisablePermute();
fastdeploy::TimeCounter tc;
tc.Start();
@@ -62,6 +64,7 @@ void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) {
tc.End();
tc.PrintInfo("SCRFD in RKNN");
std::cout << res.Str() << std::endl;
cv::imwrite("infer_rknn.jpg", vis_im);
std::cout
<< "Visualized result saved in ./infer_rknn.jpg"