GitHub - ronghanghu/caffe at lsda-nips (original) (raw)
LSDA
LSDA is a framework for large scale detection through adaptation. We combine adaptation techniques with deep convolutional models to create a fast and effective large scale detection network.
This git repository contains the fast LSDA implemenation using Geodesic Object Proposal (GOP) and Spatial Pyramid Pooling (SPP).
Caffe LSDA Release Installation Guide
- Download Caffe LSDA Release (this repo):
wget --no-check-certificate https://github.com/ronghanghu/caffe/archive/lsda-nips.zip
unzip lsda-nips.zip
Let's call the path to caffe-lsda-nips$CAFFE_ROOT
(you can runexport CAFFE_ROOT=$(pwd)/caffe-lsda-nips
) - Download and build Geodesic Object Proposal (GOP) libraries
- Make sure you have installed all GOP depencencies: * cmake (2.8.9 or higher) * g++-4.8 (or other compliers supporting C++11, see Note 1)
- do NOT use g++ 4.8.1 due to its fatal bug, use g++ 4.8.2 or higher. * Eigen3* libpng * libjpeg
on Ubuntu (tested on 14.04 LTS), you can install them using apt-get:sudo apt-get install cmake g++-4.8 libeigen3-dev libpng-dev libjpeg-dev
If you are using the a Ubuntu version lower than 14.04 and installation script does not work, see Note 2.
- do NOT use g++ 4.8.1 due to its fatal bug, use g++ 4.8.2 or higher. * Eigen3* libpng * libjpeg
- Run the following commands to download and build Geodesic Object Proposal (GOP) libraries:
cd $CAFFE_ROOT/lib
./download_gop.sh
./build_gop_libraries.sh
- Build Caffe LSDA Release
Please follow the Caffe installation instructions.
Also, make sure that your CUDA version supports g++-4.8 (or the compiler you are using to compile GOP, see Note 1). It is highly recommended to complie caffe with latest CUDA 6.5. - Try out LSDA example
- Download the lsda caffe model:
cd $CAFFE_ROOT/examples/lsda-nips
./download_model.sh
- Enjoy the car detection example * 5-scale Spatial Pyramid Pooling:
./lsda_5_scale.sh
* 1-scale Spatial Pyramid Pooling (faster than 5-scale but less accurate):./lsda_1_scale.sh
* You may also want to try out the 1-scale webcam demo if there is a webcam on your machine:./lsda_webcam.sh
If you want to run on your own image, you can simply modifylsda_5_scale.sh
orlsda_1_scale.sh
and replace-impath input.jpg
with path to your own image.
Note 1: To link the GOP libraries and caffe libraries together, they must be compiled using the same C++ compiler with C++11 support. If you want to use a compiler other than g++-4.8, you must modify the first line in $CAFFE_ROOT/Makefile
before you compile caffe and the first line in $CAFFE_ROOT/lib/gop_wrapper/CMakeLists.txt
before you compile GOP. Also make sure that CUDA nvcc supports your compiler.
Note 2: If the script to install GOP dependencies does not work on early Ubuntu version (e.g. 12.04 LTS), you may add the Ubuntu 14.04 package source to your software source list. For example, if you want to use the UC Davis source, add deb http://mirror.math.ucdavis.edu/ubuntu/ trusty main restricted universe
to your /etc/apt/sources.list
, run sudo apt-get update
and run sudo apt-get install cmake g++-4.8 libeigen3-dev libpng-dev libjpeg-dev
. Or, you can install the GOP dependencies (especially g++-4.8 and Eigen3) manually.