18 #ifndef DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H
19 #define DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H
21 #include <ds3d/common/common.h>
22 #include <ds3d/common/func_utils.h>
24 #include "ds3d/common/hpp/yaml_config.hpp"
26 #include "infer_utils.h"
31 namespace ds3d {
namespace impl {
namespace filter {
35 bool is2DFrame =
false;
41 uint32_t memPoolSize = 8;
53 LOG_ERROR(
"lidarpreprocess configed wrong mem_pool_size");
65 "parse dataloader component content failed");
67 auto filterInputDatamapKey = node[
"filter_input_datamap_key"];
68 auto yMemPoolSize = node[
"mem_pool_size"];
69 auto modelInputs = node[
"model_inputs"];
70 auto gpuid = node[
"gpu_id"];
71 auto inputTensorMemType = node[
"input_tensor_mem_type"];
72 auto configPath = node[
"config_path"];
73 auto lidarDataFrom = node[
"lidar_data_from"];
75 if (filterInputDatamapKey) {
82 for (
const auto& item :modelInputs) {
85 des.
name = item[
"name"].as<std::string>();
87 if (item[
"datatype"]){
88 dataType = item[
"datatype"].as<std::string>();
91 std::vector<std::string> strStreams = item[
"shape"].as<std::vector<std::string>>();
94 des.
dims.
d[i] = std::stoi(strStreams[i]);
97 [](
int s,
int i) { return s * i; });
99 des.
fromKey = item[
"from"].as<std::string>();
101 if (item[
"is_2d_frame"]) {
102 des.
is2DFrame = item[
"is_2d_frame"].as<
bool>();
105 "modelInputs name:%s, dataType:%s, ndataType:%d, numDims:%d, numElements:%d, from: "
113 config.
gpuid = gpuid.as<uint>();
115 if (inputTensorMemType) {
116 std::string value = inputTensorMemType.as<std::string>();
117 if(!value.compare(
"GpuCuda")){
119 }
else if (!value.compare(
"CpuCuda") || !value.compare(
"Cpu")) {
122 LOG_WARNING(
"%s not supported, use defualt value GpuCuda", value.c_str());
126 config.
configPath = configPath.as<std::string>();
129 config.
lidarDataFrom = lidarDataFrom.as<std::vector<std::string>>();
140 LOG_ERROR(
"model_inputs parse failed, abort");
148 return ErrCode::kGood;
153 #endif // DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H