Git Product home page Git Product logo

fcn8_ros's Introduction

Semantic Segmentation in ROS

Implementing a ros package for interfacing FCN-8 with ROS. FCN-8 is described in (link) and the original code (not made by me) is available at (link).

(Tested on Ubuntu 16.04, ROS Kinetic, Python 2.7.12, opencv 3.2.0-dev, Cuda 8.0, cuDNN 6.0)

Install dependencies

ROS kinetic

Follow the ROS installation guide for download and installation.

Get nvidia drivers (Only if GPU is used)

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

Get the newest driver with the “Software & Updates” application in the “Additional Drivers”-tab.

CUDA 8.0 (Only if GPU is used)

Software requires CUDA to be installed. Go to download page select your platform, download and follow instructions. In Select Target Platform i used Linux/x86_64/16.04/deb (local)

cuDNN 6.0 (Only if GPU is used)

(You will need a nvidia user) Download cuDNN link. Extract zipped folder and copy to /usr/local/cuda-8.0

cd ~/Downloads/cuda (This is the directory of the extracted folder)
sudo cp ./include/* /usr/local/cuda-8.0/include/
sudo cp ./lib64/* /usr/local/cuda-8.0/lib64/

Caffe

Install caffe dependencies

sudo apt-get install libboost-dev libprotobuf-dev protobuf-compiler libgflags-dev libgoogle-glog-dev libblas-dev libhdf5-serial-dev libopencv-dev libleveldb-dev liblmdb-dev libboost-all-dev libatlas-base-dev libsnappy-dev python-pip
pip install scipy
pip install numpy
pip install -U scikit-image
pip install protobuf
//apt-get install python-opencv

Caffe

Get nvidias edition of caffe and git clone it to ~/Code/

cd && mkdir Code && cd Code 

You may either select original caffe version from Berkeley (Caffe (Berkeley)) or nvidias edition (Caffe (nvidia)). git clone https://github.com/BVLC/caffe.git # Caffe (Berkeley) git clone https://github.com/NVIDIA/caffe.git # Caffe (nvidia)

In Makefile replace LIBRARIES line (around 183) with

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

Make a copy of Makefile.config.example

cd ~/Code/caffe
cp Makefile.config.example Makefile.config

Add /usr/include/hdf5/serial/ to INCLUDE_DIRS (around line 94-96)

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

Same for both Caffe (nvidia) and Caffe (berkeley)

Include the following lines in the Makefile.config

USE_CUDNN := 1 	(Only if GPU is used)
WITH_PYTHON_LAYER := 1

RESTART computer before building caffe sudo reboot now

Build caffe

cd ~/Code/caffe
make all -j8
make test -j8
make runtest -j8
make pycaffe

One-liner
make all -j8 && make test -j8 && make runtest -j8 && make pycaffe

Append the following lines to ~/.bashrc

# CAFFE 
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CAFFE_ROOT=~/Code/caffe # (IMPORTANT TO SET THIS AS THE INSTALL DIRECTORY OF CAFFE)
export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH

Install semantic segmentation

Git clone the package to your ros-workspace repository.

cd <your_workspace>/src
git clone https://github.com/PeteHeine/RosSemanticSegmentation

Get weights. (Prototxt and caffemodel is from here)

cd <your_workspace>/src/fcn8_ros/models/
wget http://dl.caffe.berkeleyvision.org/pascalcontext-fcn8s-heavy.caffemodel

fcn8_ros's People

Contributors

pete-machine avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar paper2code - bot avatar

fcn8_ros's Issues

ImportError: No module named boundingbox_msgs.msg

Hello,

Are there some dependencies that need to be installed? such as boundingbox_msgs.msg. I am getting this from running ros_semantic_segmentation.py.
from boundingbox_msgs.msg import ImageDetections
ImportError: No module named boundingbox_msgs.msg

Cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.