[Model] Support PP-ShiTuV2 models for PaddleClas (#1900)

* [cmake] add faiss.cmake -> pp-shituv2

* [PP-ShiTuV2] Support PP-ShituV2-Det model

* [PP-ShiTuV2] Support PP-ShiTuV2-Det model

* [PP-ShiTuV2] Add PPShiTuV2Recognizer c++&python support

* [PP-ShiTuV2] Add PPShiTuV2Recognizer c++&python support

* [Bug Fix] fix ppshitu_pybind error

* [benchmark] Add ppshituv2-det c++ benchmark

* [examples] Add PP-ShiTuV2 det & rec examples

* [vision] Update vision classification result

* [Bug Fix] fix trt shapes setting errors
This commit is contained in:
DefTruth
2023-05-08 14:04:09 +08:00
committed by GitHub
parent df8dd3e3ac
commit 77cb9db6da
31 changed files with 1835 additions and 51 deletions

7
benchmark/cpp/benchmark_picodet.cc Executable file → Normal file
View File

@@ -49,8 +49,7 @@ int main(int argc, char* argv[]) {
config_info["backend"] == "trt") {
option.trt_option.SetShape("image", {1, 3, 640, 640}, {1, 3, 640, 640},
{1, 3, 640, 640});
option.trt_option.SetShape("scale_factor", {1, 2}, {1, 2},
{1, 2});
option.trt_option.SetShape("scale_factor", {1, 2}, {1, 2}, {1, 2});
}
auto model_picodet = vision::detection::PicoDet(
model_file, params_file, config_file, option, model_format);
@@ -81,9 +80,9 @@ int main(int argc, char* argv[]) {
}
// Run profiling
BENCHMARK_MODEL(model_picodet, model_picodet.Predict(im, &res))
auto vis_im = vision::VisDetection(im, res);
auto vis_im = vision::VisDetection(im, res, 0.5f);
cv::imwrite("vis_result.jpg", vis_im);
std::cout << "Visualized result saved in ./vis_result.jpg" << std::endl;
#endif
return 0;
}
}