mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 00:33:03 +08:00
[Benchmark] Add GetModelResoucesNameFromDir APIs (#1640)
This commit is contained in:
@@ -35,9 +35,14 @@ int main(int argc, char* argv[]) {
|
||||
std::unordered_map<std::string, std::string> config_info;
|
||||
benchmark::ResultManager::LoadBenchmarkConfig(FLAGS_config_path,
|
||||
&config_info);
|
||||
// Recognition Model
|
||||
auto rec_model_file = FLAGS_model + sep + "inference.pdmodel";
|
||||
auto rec_params_file = FLAGS_model + sep + "inference.pdiparams";
|
||||
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, false)) {
|
||||
return -1;
|
||||
}
|
||||
auto model_file = FLAGS_model + sep + model_name;
|
||||
auto params_file = FLAGS_model + sep + params_name;
|
||||
if (config_info["backend"] == "paddle_trt") {
|
||||
option.paddle_infer_option.collect_trt_shape = true;
|
||||
}
|
||||
@@ -49,7 +54,7 @@ int main(int argc, char* argv[]) {
|
||||
trt_shapes[2]);
|
||||
}
|
||||
auto model_ppocr_rec = vision::ocr::Recognizer(
|
||||
rec_model_file, rec_params_file, FLAGS_rec_label_file, option);
|
||||
model_file, params_file, FLAGS_rec_label_file, option, model_format);
|
||||
std::string text;
|
||||
float rec_score;
|
||||
if (config_info["precision_compare"] == "true") {
|
||||
|
Reference in New Issue
Block a user