MengNan-Li / ros_opencl_caffe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ros_opencl_caffe

Introduction

OpenCL Caffe(clCaffe) is an OpenCL backend for Caffe from Intel®. With inference optimized by Intel® OpenCL, clCaffe can be used in most scene in high performance, like objects inference.

This project is a ROS wrapper for OpenCL Caffe, providing following features:

  • A ROS service for objects inference in a ROS image message
  • A ROS publisher for objects inference in a ROS image message from a RGB camera
  • Demo applications to show the capablilities of ROS service and publisher

Prerequisite

  • An x86_64 computer with Ubuntu 16.04
  • ROS Kinetic
  • RGB camera, e.g. Intel® RealSense™, Microsoft® Kinect™ or standard USB camera

Environment Setup

  • Install ROS Kinetic Desktop-Full (guide)
  • Create a catkin workspace (guide)
  • Install clCaffe (guide)
  • Create a symbol link in /opt/clCaffe
  sudo ln -s <clCaffe-path> /opt/clCaffe
  • Add clCaffe libraries to LD_LIBRARY_PATH.
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/clCaffe/build/lib
  • Install ROS package for different cameras as needed. e.g.
    1. Standard USB camera
      sudo apt-get install ros-kinetic-usb-cam
    1. Intel® RealSense™ camera
    • Install Intel® RealSense™ SDK 2.0 (guide). Refer here for more details about Intel® RealSense™ SDK 2.0.
    • Install Intel® RealSense™ ROS (guide)
      cd ~/catkin_ws/src
      git clone https://github.com/intel-ros/realsense.git
      cd  realsense
      git checkout 2.0.0
      cd ~/catkin_ws
      catkin_make
    1. Microsoft® Kinect™ camera
      sudo apt-get install ros-kinetic-openni-launch

Building and Installation

  cd ~/catkin_ws/src
  git clone https://github.com/intel/object_msgs
  git clone https://github.com/intel/ros_opencl_caffe
  cd ~/catkin_ws/
  catkin_make
  catkin_make install
  source install/setup.bash

Copy object label file to clCaffe installation location

  cp ~/catkin_ws/src/ros_opencl_caffe/opencl_caffe/resources/voc.txt /opt/clCaffe/data/yolo/

Running the Demo

Inference

  1. Standard USB camera
    roslaunch opencl_caffe_launch usb_cam_viewer.launch
  1. Intel® RealSense™ camera
    roslaunch opencl_caffe_launch realsense_viewer.launch
  1. Microsoft® Kinect™ camera
    roslaunch opencl_caffe_launch kinect_viewer.launch

Service

  roslaunch opencl_caffe_launch opencl_caffe_srv.launch

Test

Use rostest for tests

  source devel/setup.bash
  rostest opencl_caffe service.test
  rostest opencl_caffe detector.test

Known Issues

  • Only image messages supported in service demo
  • Only test on RealSense D400 series camera, Microsoft Kinect v1 camera and Microsoft HD-300 USB camera

TODO

  • Support latest clCaffe
Any security issue should be reported using process at https://01.org/security

About

License:Apache License 2.0


Languages

Language:C++ 71.5%Language:CMake 28.5%