Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[WIP] Update OD module
  • Loading branch information
Myzhar committed Sep 22, 2023
commit acb2750ce52e969726b4ae1f1c659155e00a866c
33 changes: 25 additions & 8 deletions zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,16 +1086,33 @@ void ZEDWrapperNodelet::readObjDetParams()
}
NODELET_INFO_STREAM(" * Detection max range\t\t-> " << mObjDetMaxRange);

int model;
mNhNs.getParam("object_detection/model", model);
if (model < 0 || model >= static_cast<int>(sl::OBJECT_DETECTION_MODEL::LAST))
std::string model_str;
mNhNs.getParam("object_detection/model", model_str);

NODELET_DEBUG_STREAM(" 'object_detection.model': " << model_str.c_str());

bool matched = false;
for (int idx = static_cast<int>(sl::OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_FAST);
idx < static_cast<int>(sl::OBJECT_DETECTION_MODEL::CUSTOM_BOX_OBJECTS); idx++)
{
sl::OBJECT_DETECTION_MODEL test_model = static_cast<sl::OBJECT_DETECTION_MODEL>(idx);
std::string test_model_str = sl::toString(test_model).c_str();
std::replace(test_model_str.begin(), test_model_str.end(), ' ',
'_'); // Replace spaces with underscores to match the YAML setting
// NODELETDEBUG(" Comparing '%s' to '%s'", test_model_str.c_str(), model_str.c_str());
if (model_str == test_model_str)
{
mObjDetModel = test_model;
matched = true;
break;
}
}
if (!matched)
{
NODELET_WARN("Detection model not valid. Forced to the default value");
model = static_cast<int>(mObjDetModel);
NODELET_WARN_STREAM( "The value of the parameter 'object_detection.model' is not valid: '"
<< model_str << "'. Using the default value.");
}
mObjDetModel = static_cast<sl::OBJECT_DETECTION_MODEL>(model);

NODELET_INFO_STREAM(" * Detection model\t\t-> " << sl::toString(mObjDetModel));
NODELET_INFO_STREAM(" * Object Det. model:\t" << sl::toString(mObjDetModel).c_str());

mNhNs.getParam("object_detection/mc_people", mObjDetPeopleEnable);
NODELET_INFO_STREAM(" * Detect people\t\t-> " << (mObjDetPeopleEnable ? "ENABLED" : "DISABLED"));
Expand Down
3 changes: 1 addition & 2 deletions zed_wrapper/params/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ sensors:

object_detection:
od_enabled: false # True to enable Object Detection [not available for ZED]
model: 0 # '0': MULTI_CLASS_BOX - '1': MULTI_CLASS_BOX_ACCURATE
confidence_threshold: 50 # Minimum value of the detection confidence of an object [0,100]
model: 'MULTI_CLASS_BOX_ACCURATE' # 'MULTI_CLASS_BOX_FAST', 'MULTI_CLASS_BOX_MEDIUM', 'MULTI_CLASS_BOX_ACCURATE', 'PERSON_HEAD_BOX_FAST', 'PERSON_HEAD_BOX_ACCURATE'
max_range: 15. # Maximum detection range
object_tracking_enabled: true # Enable/disable the tracking of the detected objects
mc_people: true # Enable/disable the detection of persons for 'MULTI_CLASS_BOX_X' models
Expand Down
2 changes: 1 addition & 1 deletion zed_wrapper/params/zed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ general:

depth:
min_depth: 0.3 # Min: 0.3, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 10.0 # Max: 40.0
max_depth: 15.0 # Max: 40.0
2 changes: 1 addition & 1 deletion zed_wrapper/params/zed2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ general:

depth:
min_depth: 0.3 # Min: 0.2, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 20.0 # Max: 40.0
max_depth: 15.0 # Max: 40.0

2 changes: 1 addition & 1 deletion zed_wrapper/params/zed2i.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ general:

depth:
min_depth: 0.3 # Min: 0.3, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 10.0 # Max: 40.0
max_depth: 15.0 # Max: 40.0
2 changes: 1 addition & 1 deletion zed_wrapper/params/zedm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ general:

depth:
min_depth: 0.1 # Min: 0.1, Max: 3.0 - Default 0.3 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 10.0 # Max: 20.0
max_depth: 15.0 # Max: 20.0
2 changes: 1 addition & 1 deletion zed_wrapper/params/zedx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ general:

depth:
min_depth: 0.2 # Min: 0.2, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 10.0 # Max: 40.0
max_depth: 15.0 # Max: 40.0

2 changes: 1 addition & 1 deletion zed_wrapper/params/zedxm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ general:

depth:
min_depth: 0.1 # Min: 0.1, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
max_depth: 10.0 # Max: 40.0
max_depth: 15.0 # Max: 40.0