|
| 1 | +# ROS Wrapper for Openface 2.1.0 |
| 2 | + |
| 3 | +This is a ROS wrapper for OpenFace 2.1.0. In particular, given an image of a face, it will output: |
| 4 | + * Eye Gaze Vectors |
| 5 | + * Head Pose |
| 6 | + * 2D Landmarks |
| 7 | + * 3D Landmarks |
| 8 | + * Action Units |
| 9 | + * Debug Visualization (optional) |
| 10 | + |
| 11 | +## ROS Parameters |
| 12 | + |
| 13 | +### Required |
| 14 | + * `~image_topic` - The topic the image is provided on (e.g. `/usb_cam/image_raw`). |
| 15 | + |
| 16 | +### Optional |
| 17 | + * `~publish_viz` - Set to `true` to publish a debug visualization (default: `false`). |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +* Clone the OpenFace project release 2.1.0 : `git clone https://github.com/TadasBaltrusaitis/OpenFace/tree/OpenFace_2.1.0` |
| 22 | +* Download model : [Model download · TadasBaltrusaitis/OpenFace Wiki · GitHub](https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download) |
| 23 | +* Install OpenFace, following this instruction : [Unix Installation · TadasBaltrusaitis/OpenFace Wiki · GitHub](https://github.com/TadasBaltrusaitis/OpenFace/wiki/Unix-Installation) (don't forget to sudo make install at the end) |
| 24 | +* Download [openface2_ros](https://github.com/ditoec/openface_ros) to your catkin src folder and `cd .. && catkin make` |
| 25 | +* Clone [`usb_cam` ros node](http://wiki.ros.org/usb_cam) or other ros node of your choice for interfacing with USB camera |
| 26 | + |
| 27 | +### Running |
| 28 | + |
| 29 | +* `roscore` |
| 30 | +* `rosrun usb_cam usb_cam_node` |
| 31 | +* `roslaunch openface2_ros openface2_ros.launch` |
| 32 | + |
| 33 | +### Notes |
| 34 | + |
| 35 | +This node requires `cv_bridge` *and* OpenCV 3. You must ensure that `cv_bridge` is also linked against OpenCV 3. If you get a warning during compilation, you may have to manually clone the `vision_opencv` repository and re-build `cv_bridge`. |
| 36 | + |
| 37 | +### Issues |
| 38 | + |
| 39 | +If running `openface2_ros` results in a segfault or you see the following lines when running `catkin_make`: |
| 40 | + |
| 41 | + /usr/bin/ld: warning: libopencv_imgproc.so.2.4, needed by /opt/ros/indigo/lib/libcv_bridge.so, may conflict with libopencv_imgproc.so.3.1 |
| 42 | + /usr/bin/ld: warning: libopencv_highgui.so.2.4, needed by /opt/ros/indigo/lib/libcv_bridge.so, may conflict with libopencv_highgui.so.3.1 |
| 43 | + /usr/bin/ld: warning: libopencv_calib3d.so.2.4, needed by /usr/lib/x86_64-linux-gnu/libopencv_contrib.so.2.4.8, may conflict with libopencv_calib3d.so.3.1 |
| 44 | + |
| 45 | +then openface2 ros is linking against OpenCV2 instead of OpenCV3. To fix this: update cmake to at least 3.6.2, rebuild OpenCV3, clone vision\_opencv into the src folder of your catkin workspace, then recompile cv\_bridge. Remake your catkin workspace, and the segfault and warnings should have been resolved. |
| 46 | + |
| 47 | +## Published Topics |
| 48 | + |
| 49 | +* `/openface2/faces` ( `openface2_ros/faces` ) |
| 50 | +* `/openface2/image` ( `sensor_msgs/Image` ) |
| 51 | + |
| 52 | +## Messages |
| 53 | + |
| 54 | +### Faces |
| 55 | +``` |
| 56 | +std_msgs/Header header |
| 57 | +
|
| 58 | +openface_ros/Face[] faces |
| 59 | +uint32 count``` |
| 60 | +``` |
| 61 | + |
| 62 | +### FaceFeatures |
| 63 | +``` |
| 64 | +geometry_msgs/Vector3 left_gaze |
| 65 | +geometry_msgs/Vector3 right_gaze |
| 66 | +geometry_msgs/Vector3 gaze_angle |
| 67 | +
|
| 68 | +geometry_msgs/Pose head_pose |
| 69 | +
|
| 70 | +geometry_msgs/Point[] landmarks_3d |
| 71 | +geometry_msgs/Point[] landmarks_2d |
| 72 | +
|
| 73 | +openface_ros/ActionUnit[] action_units |
| 74 | +``` |
| 75 | + |
| 76 | +### ActionUnit |
| 77 | +``` |
| 78 | +string name |
| 79 | +float64 presence |
| 80 | +float64 intensity |
| 81 | +``` |
| 82 | + |
| 83 | +## Changelog |
| 84 | +* Accommodate major changes in openface 2.0.6 (functions and classes naming & grouping) |
| 85 | +* Add eye gaze angle in the Face message type |
| 86 | +* Add Faces message type (an array of Face message type) in order to accommodate the new multiple face detection in openface 2.0 |
0 commit comments