Skip to content

Commit

Permalink
[objectness] add default training_path arg to pass the test and add F…
Browse files Browse the repository at this point in the history
…ATAL when no training path were given
  • Loading branch information
mqcmd196 committed Apr 12, 2022
1 parent ba92d8d commit bfca234
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions launch/objectness.launch
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<arg name="debug_view" default="true" doc="Specify whether the node displays a window to show image" />
<arg name="queue_size" default="3" doc="Specigy queue_size of input image subscribers" />

<arg name="training_path" doc="The path of trained model.
Please download
https://github.com/opencv/opencv_contrib/tree/3.4/modules/saliency/samples/ObjectnessTrainedModel" />
<arg name="training_path" default="" doc="The path of trained model.
Please download
https://github.com/opencv/opencv_contrib/tree/3.4/modules/saliency/samples/ObjectnessTrainedModel" />
<arg name="nss" default="2" doc="Size for non-maximal suppress" />
<arg name="max_objectness" default="10" doc="Maximum number of objectness to be detected" />

Expand Down
3 changes: 3 additions & 0 deletions src/nodelet/objectness_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ class ObjectnessNodelet : public opencv_apps::Nodelet
pnh_->param("debug_view", debug_view_, false);
pnh_->getParam("training_path", training_path_);

if (training_path_.empty())
NODELET_FATAL("Please set the path to directory of training data");

window_name_ = "Objectness View";

objectnessAlgorithm = cv::saliency::ObjectnessBING::create(); // support BING
Expand Down
6 changes: 3 additions & 3 deletions test/test-objectness.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
</node>
<param name="objectness_test/topic" value="objectness/image" />
<test test-name="objectness_test" pkg="rostest" type="hztest" name="objectness_test" >
<param name="hz" value="10" />
<param name="hzerror" value="5" />
<param name="test_duration" value="5.0" />
<param name="hz" value="5" />
<param name="hzerror" value="10.0" />
<param name="test_duration" value="1.0" />
</test>

</group>
Expand Down

0 comments on commit bfca234

Please sign in to comment.