From f02a2299c4866ab0764767bb638a49ea21fd8039 Mon Sep 17 00:00:00 2001 From: Vibhav Aggarwal Date: Thu, 1 Feb 2024 19:36:31 +0900 Subject: mv_machine_learning: minor bug fixes [Issue type] bug fix Use default model name in case no model name is provided. Also, fix a typo in PostprocessParser.h. Change-Id: I82abf52e6c3ca582721a69ffabd1745e8b2e8462 Signed-off-by: Vibhav Aggarwal --- .../object_detection/include/ObjectDetectionAdapter.h | 2 +- .../object_detection/src/ObjectDetectionAdapter.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'mv_machine_learning/object_detection') diff --git a/mv_machine_learning/object_detection/include/ObjectDetectionAdapter.h b/mv_machine_learning/object_detection/include/ObjectDetectionAdapter.h index 098964e4..e62c4b1d 100644 --- a/mv_machine_learning/object_detection/include/ObjectDetectionAdapter.h +++ b/mv_machine_learning/object_detection/include/ObjectDetectionAdapter.h @@ -37,7 +37,7 @@ private: const std::string _config_file_name = "object_detection.json"; const std::string _plugin_config_file_name = "object_detection_plugin.json"; - void create(std::string model_name = ""); + void create(const std::string &model_name = ""); template void create(ObjectDetectionTaskType task_type); ObjectDetectionTaskType convertToTaskType(std::string model_name); diff --git a/mv_machine_learning/object_detection/src/ObjectDetectionAdapter.cpp b/mv_machine_learning/object_detection/src/ObjectDetectionAdapter.cpp index 1b7e4c6e..d089f05d 100644 --- a/mv_machine_learning/object_detection/src/ObjectDetectionAdapter.cpp +++ b/mv_machine_learning/object_detection/src/ObjectDetectionAdapter.cpp @@ -61,12 +61,9 @@ template void ObjectDetectionAdapter::create(ObjectDetectionTaskType // TODO. } -void ObjectDetectionAdapter::create(string model_name) +void ObjectDetectionAdapter::create(const string &model_name) { - if (model_name.empty()) - model_name = _config->getDefaultModelName(); - - auto task_type = convertToTaskType(model_name); + auto task_type = convertToTaskType(model_name.empty() ? _config->getDefaultModelName() : model_name); if (_config->isPluginUsed()) { const auto &plugin_name = _config->getPluginFileName(); -- cgit v1.2.3