mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 17:17:14 +08:00
[Benchmark] Add GetModelResoucesNameFromDir APIs (#1640)
This commit is contained in:
16
benchmark/cpp/benchmark_ppyolov5.cc
Executable file → Normal file
16
benchmark/cpp/benchmark_ppyolov5.cc
Executable file → Normal file
@@ -32,11 +32,17 @@ int main(int argc, char* argv[]) {
|
||||
std::unordered_map<std::string, std::string> config_info;
|
||||
benchmark::ResultManager::LoadBenchmarkConfig(FLAGS_config_path,
|
||||
&config_info);
|
||||
auto model_file = FLAGS_model + sep + "model.pdmodel";
|
||||
auto params_file = FLAGS_model + sep + "model.pdiparams";
|
||||
auto config_file = FLAGS_model + sep + "infer_cfg.yml";
|
||||
auto model_ppyolov5 = vision::detection::PaddleYOLOv5(model_file, params_file,
|
||||
config_file, option);
|
||||
std::string model_name, params_name, config_name;
|
||||
auto model_format = fastdeploy::ModelFormat::PADDLE;
|
||||
if (!UpdateModelResourceName(&model_name, ¶ms_name, &config_name,
|
||||
&model_format, config_info)) {
|
||||
return -1;
|
||||
}
|
||||
auto model_file = FLAGS_model + sep + model_name;
|
||||
auto params_file = FLAGS_model + sep + params_name;
|
||||
auto config_file = FLAGS_model + sep + config_name;
|
||||
auto model_ppyolov5 = vision::detection::PaddleYOLOv5(
|
||||
model_file, params_file, config_file, option, model_format);
|
||||
vision::DetectionResult res;
|
||||
if (config_info["precision_compare"] == "true") {
|
||||
// Run once at least
|
||||
|
Reference in New Issue
Block a user