<launch>
  <arg name="model" default="vgg_cnn_m_1024" />
  <arg name="gui" default="true" />
  <arg name="gpu" default="0" />

  <node name="image_publisher"
        pkg="jsk_perception" type="image_publisher.py">
    <rosparam subst_value="true">
      file_name: $(find jsk_perception)/sample/object_detection_example_1.jpg
      encoding: bgr8
      publish_info: false
    </rosparam>
  </node>
  <arg name="INPUT_IMAGE" default="image_publisher/output" />

  <include file="$(find jsk_perception)/launch/fast_rcnn.launch">
    <arg name="INPUT_IMAGE" default="$(arg INPUT_IMAGE)" />
    <arg name="MODEL" value="$(arg model)" />
    <arg name="GPU" value="$(arg gpu)" />
  </include>

  <node name="draw_rects" pkg="jsk_perception" type="draw_rects"
        output="screen">
    <remap from="~input" to="$(arg INPUT_IMAGE)" />
    <remap from="~input/rects" to="fast_rcnn/output/rect_array" />
    <remap from="~input/class" to="fast_rcnn/output/class" />
    <rosparam>
      use_classification_result: true
    </rosparam>
  </node>

  <group if="$(arg gui)">
    <node name="image_view"
          pkg="image_view" type="image_view">
      <remap from="image" to="draw_rects/output" />
    </node>
  </group>

</launch>
