14 #ifndef DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H
15 #define DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H
17 #include <ds3d/common/common.h>
18 #include <ds3d/common/func_utils.h>
20 #include "ds3d/common/hpp/yaml_config.hpp"
22 #include "infer_utils.h"
27 namespace ds3d {
namespace impl {
namespace filter {
31 bool is2DFrame =
false;
37 uint32_t memPoolSize = 8;
49 LOG_ERROR(
"lidarpreprocess configed wrong mem_pool_size");
61 "parse dataloader component content failed");
63 auto filterInputDatamapKey = node[
"filter_input_datamap_key"];
64 auto yMemPoolSize = node[
"mem_pool_size"];
65 auto modelInputs = node[
"model_inputs"];
66 auto gpuid = node[
"gpu_id"];
67 auto inputTensorMemType = node[
"input_tensor_mem_type"];
68 auto configPath = node[
"config_path"];
69 auto lidarDataFrom = node[
"lidar_data_from"];
71 if (filterInputDatamapKey) {
78 for (
const auto& item :modelInputs) {
81 des.
name = item[
"name"].as<std::string>();
83 if (item[
"datatype"]){
84 dataType = item[
"datatype"].as<std::string>();
87 std::vector<std::string> strStreams = item[
"shape"].as<std::vector<std::string>>();
90 des.
dims.
d[i] = std::stoi(strStreams[i]);
93 [](
int s,
int i) { return s * i; });
95 des.
fromKey = item[
"from"].as<std::string>();
97 if (item[
"is_2d_frame"]) {
98 des.
is2DFrame = item[
"is_2d_frame"].as<
bool>();
101 "modelInputs name:%s, dataType:%s, ndataType:%d, numDims:%d, numElements:%d, from: "
109 config.
gpuid = gpuid.as<uint>();
111 if (inputTensorMemType) {
112 std::string value = inputTensorMemType.as<std::string>();
113 if(!value.compare(
"GpuCuda")){
115 }
else if (!value.compare(
"CpuCuda") || !value.compare(
"Cpu")) {
118 LOG_WARNING(
"%s not supported, use defualt value GpuCuda", value.c_str());
122 config.
configPath = configPath.as<std::string>();
125 config.
lidarDataFrom = lidarDataFrom.as<std::vector<std::string>>();
136 LOG_ERROR(
"model_inputs parse failed, abort");
144 return ErrCode::kGood;
149 #endif // DS3D_DATAFILTER_LIDAR_PREPROCESS_CONFIG_H