Skip to content

Commit 853c484

Browse files
committed
Refactor: use getName() instead of raw strings in converter_facade
Replace hardcoded converter name strings ("keypoints_openpose", "keypoints_hrnet", "keypoints_3d") with static getName() calls from corresponding converter classes to improve maintainability.
1 parent 51094e9 commit 853c484

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/monolithic/gst/inference_elements/common/post_processor/converter_facade.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "blob_to_meta_converter.h"
1010
#include "meta_attacher.h"
1111

12+
#include "converters/to_tensor/keypoints_3d.h"
13+
#include "converters/to_tensor/keypoints_hrnet.h"
14+
#include "converters/to_tensor/keypoints_openpose.h"
15+
1216
#include "gva_base_inference.h"
1317

1418
#include <gst/gst.h>
@@ -74,7 +78,8 @@ CoordinatesRestorer::Ptr ConverterFacade::createCoordinatesRestorer(ConverterTyp
7478
const gchar *converter = gst_structure_get_string(model_proc_output_info, "converter");
7579
if (converter) {
7680
const std::string name(converter);
77-
if (name == "keypoints_openpose" || name == "keypoints_hrnet" || name == "keypoints_3d")
81+
if (name == KeypointsOpenPoseConverter::getName() || name == KeypointsHRnetConverter::getName() ||
82+
name == Keypoints3DConverter::getName())
7883
return CoordinatesRestorer::Ptr(new KeypointsCoordinatesRestorer(input_image_info, attach_type));
7984
}
8085
}

0 commit comments

Comments
 (0)