Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions host/core/pipeline/host_pipeline_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ bool HostPipelineConfig::initWithJSON(const json &json_obj)
{
depth.padding_factor = depth_obj.at("padding_factor").get<float>();

if (depth.padding_factor < 0.f || depth.padding_factor >= 0.5)
if (depth.padding_factor < 0.f || depth.padding_factor > 1.f)
{
std::cout << "padding_factor should be in the range [0 .. 0.5)\n";
std::cout << "padding_factor should be in the range [0 .. 1]\n";
break;
}
}
Expand All @@ -78,6 +78,17 @@ bool HostPipelineConfig::initWithJSON(const json &json_obj)
{
depth.depth_limit_m = depth_obj.at("depth_limit_m").get<float>();
}

if (depth_obj.contains("confidence_threshold"))
{
depth.confidence_threshold = depth_obj.at("confidence_threshold").get<float>();

if (depth.confidence_threshold < 0.f || depth.confidence_threshold > 1.f)
{
std::cout << "confidence_threshold should be in the range [0 .. 1]\n";
break;
}
}
}

// "ai"
Expand Down
1 change: 1 addition & 0 deletions host/core/pipeline/host_pipeline_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct HostPipelineConfig
std::string type;
float padding_factor = 0.3f;
float depth_limit_m = 10.0f;
float confidence_threshold = 0.5f;
} depth;

struct AI
Expand Down
1 change: 1 addition & 0 deletions host/py_module/py_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
};
json_config_obj["depth"]["padding_factor"] = config.depth.padding_factor;
json_config_obj["depth"]["depth_limit_mm"] = (int)(config.depth.depth_limit_m * 1000);
json_config_obj["depth"]["confidence_threshold"] = config.depth.confidence_threshold;

json_config_obj["_load_inBlob"] = true;
json_config_obj["_pipeline"] =
Expand Down