Code Monkey home page Code Monkey logo

caffe-segnet-cudnn7's Introduction

Caffe SegNet cuDNN7

This is a modified version of Caffe which supports the SegNet architecture.

As described in SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation Vijay Badrinarayanan, Alex Kendall and Roberto Cipolla [http://arxiv.org/abs/1511.00561]

Please refer to Alex Kendall's caffe-segnet for tutorial and a guide how to use it (https://github.com/alexgkendall/caffe-segnet).

Since the original caffe-segnet supports just cuDNN v2, which is not supported for new pascal based GPUs, Timo Sämann was able to decrease the inference time by 25 % to 35 % with caffe-segnet-cudnn5 using Titan X Pascal. This repository contains the changes required to run using cudNN7, however no calculation of speedup was performed.

It is recommended to use Timo Sämann's weights (trained on CityScapes) for semantic segmenation of traffic scenes, which you can find in the SegNet Model Zoo.

If you like to speed up SegNet even further, you can run the BN-absorber.py script. It merges the batch normalization layer into the convolutional layer by modifying its weights and biases. In doing so, it is possible to accelerate it by around 30 %. Please find BN-absorber.py in the script folder.

If you like to use SegNet with C++, the test_segmentation.cpp might be helpful. https://github.com/navganti/SegNet/blob/master/scripts/example/test_segmentation.cpp

Installation

Makefile

To install, follow the instructions located here.

A lot of the necessary changes to the Makefile have already been made here. The above guide does, however, provide a good reference for installation dependencies and build steps.

Some tips for modifying the Makefile: - If you are using ROS and OpenCV, the location of the OpenCV (as of Ubuntu 16.04 and ROS Kinetic /opt/ros/kinetic/include/opencv-3.3.1-dev and /opt/ros/kinetic/include) needs to be appended to INCLUDE_DIRS and LIBRARY_DIRS -

This method is recommended if you wish to use Caffe with Python! Make sure to add the caffe-segnet-cudnn7/python folder to your PYTHONPATH.

CMake

To install Caffe using the community-created CMake file, perform the following:

Note: This will install Caffe to /usr/local. If you wish to install it elsewhere, set the CMAKE_INSTALL_PREFIX.

mkdir cmake_build
cd cmake_build
cmake ..
make
make runtest
sudo make install

The CMake file currently does not build the Python layer, but this can be modified inside the CMakeLists file. I have not tested this, personally.

This method is recommended if you wish to use Caffe with C++!.

To use caffe-segnet-cudnn7 in a CMake project, you can now add the following lines to your project's CMakeLists.txt:

project(foo)

find_package(Caffe REQUIRED)
include_directories(${Caffe_INCLUDE_DIRS})

add_executable(foo main.cpp)
target_link_libraries(foo ${Caffe_LIBRARIES})

News

  • If SegNet is too slow for you, try out the ENet in Caffe. It's much faster! (May 30th, 2017)

  • Speed up SegNet by merging batch normalization and convolutional layer with BN-absorber.py in the script folder. (May 12th, 2017)

  • cuDNN v.6 has been released. I have tested it using Titan X Pascal. It doesn't bring any noticeable improvements for SegNet. For that reason will not update the repository to cuDNN6.

Publications

If you use this software in your research, please cite their publications:

http://arxiv.org/abs/1511.02680 Alex Kendall, Vijay Badrinarayanan and Roberto Cipolla "Bayesian SegNet: Model Uncertainty in Deep Convolutional Encoder-Decoder Architectures for Scene Understanding." arXiv preprint arXiv:1511.02680, 2015.

http://arxiv.org/abs/1511.00561 Vijay Badrinarayanan, Alex Kendall and Roberto Cipolla "SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation." arXiv preprint arXiv:1511.00561, 2015.

License

This extension to the Caffe library is released under a creative commons license which allows for personal and research use only. For a commercial license please contact the authors. You can view a license summary here: http://creativecommons.org/licenses/by-nc/4.0/

caffe-segnet-cudnn7's People

Contributors

blgene avatar cypof avatar dgolden1 avatar ducha-aiki avatar eelstork avatar erictzeng avatar flx42 avatar jamt9000 avatar jeffdonahue avatar jyegerlehner avatar kkhoot avatar kloudkl avatar longjon avatar lukeyeager avatar mavenlin avatar mohomran avatar mtamburrano avatar netheril96 avatar philkr avatar qipeng avatar rbgirshick avatar ronghanghu avatar sergeyk avatar sguada avatar shelhamer avatar ste-m5s avatar timmeinhardt avatar tnarihi avatar yangqing avatar yosinski avatar

Watchers

 avatar

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.