Skip to content

Commit

Permalink
ROS Packages
Browse files Browse the repository at this point in the history
- Estimator / Broadcaster
- Visualizer

Mobilenet_thin_463x368 graph added
  • Loading branch information
ildoonet committed Jan 10, 2018
1 parent 4d1fb25 commit c3f7876
Show file tree
Hide file tree
Showing 39 changed files with 126,068 additions and 555 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ generate_messages(
)

catkin_package(
CATKIN_DEPENDS message_generation message_runtime
CATKIN_DEPENDS rospy message_generation message_runtime
)

install()
install()
Binary file added etcs/dance.mp4
Binary file not shown.
14 changes: 14 additions & 0 deletions etcs/training.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,18 @@ $ bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
fold_constants(ignoreError=False)
fold_old_batch_norms
fold_batch_norms'
```

Also, It is promising to quantize neural network in 8 bit to get futher improvement for speed. In my case, this will make inference less accurate and take more time on Intel's CPUs.

```
$ bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph=/Users/ildoonet/repos/tf-openpose/tmp/cmu_640x480/graph_opt.pb \
--out_graph=/Users/ildoonet/repos/tf-openpose/tmp/cmu_640x480/graph_q.pb \
--inputs='image' \
--outputs='Openpose/concat_stage7:0' \
--transforms='add_default_attributes strip_unused_nodes(type=float, shape="1,360,640,3")
remove_nodes(op=Identity, op=CheckNumerics) fold_constants(ignore_errors=true)
fold_batch_norms fold_old_batch_norms quantize_weights quantize_nodes
strip_unused_nodes sort_by_execution_order'
```
14 changes: 0 additions & 14 deletions launch/demo_camera.launch

This file was deleted.

44 changes: 44 additions & 0 deletions launch/demo_video.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<launch>
<arg name="video" default="$(find tfpose_ros)/etcs/dance.mp4" />
<arg name="video_width" default="1280" />
<arg name="video_height" default="720" />

<arg name="gpuid" default="0" />

<arg name="model" default="mobilenet_thin_432x368" />
<!--
<arg name="model" default="cmu_640x360" />
-->

<node name="pose_estimator" pkg="tfpose_ros" type="broadcaster_ros.py" output="screen" required="true">
<env name="CUDA_VISIBLE_DEVICES" value="$(arg gpuid)" />
<param name="camera" value="/videofile/image_raw" />
<param name="model" value="$(arg model)" />
</node>

<node name="pose_estimator_vis" pkg="tfpose_ros" type="visualization.py" output="screen" required="true">
<param name="camera" value="/videofile/image_raw" />
<param name="pose" value="/pose_estimator/pose" />
<param name="resize_ratio" value="0.3" />
</node>

<node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen" required="true">
<remap from="image" to="/pose_estimator_vis/output"/>
<param name="autosize" value="true" />
</node>

<include file="$(find video_stream_opencv)/launch/camera.launch">
<arg name="camera_name" value="videofile" />
<!-- means video device 0, /dev/video0 -->
<arg name="video_stream_provider" value="$(arg video)" />
<!-- throttling the querying of frames to -->
<arg name="fps" value="30" />
<!-- setting frame_id -->
<arg name="frame_id" value="videofile_frame" />
<arg name="width" value="$(arg video_width)"/>
<arg name="height" value="$(arg video_height)"/>
<arg name="visualize" value="true" />
</include>

</launch>
Loading

0 comments on commit c3f7876

Please sign in to comment.