项目作者: alessandrozamberletti

项目描述 :
Cpp image classification with Caffe and OpenCV
高级语言: Makefile
项目地址: git://github.com/alessandrozamberletti/caffe-classification.git
创建时间: 2018-07-01T20:37:22Z
项目社区:https://github.com/alessandrozamberletti/caffe-classification

开源协议:MIT License

下载


Caffe-Classification

Image classification with Caffe and OpenCV in 50 lines of code


margi
margi

Instructions Ubuntu 16.04

  • Install dependencies
    1. sudo apt-get update &&
    2. sudo apt-get -y upgrade &&
    3. sudo apt-get -y install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libboost-all-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libopenblas-dev wget libcurl4-openssl-dev libatlas-base-dev git
  • Install OpenCV v3.0.0
    1. wget https://github.com/opencv/opencv/archive/3.0.0.zip &&
    2. unzip 3.0.0.zip &&
    3. cd opencv-3.0.0 &&
    4. mkdir build &&
    5. cd build &&
    6. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv -D WITH_IPP=OFF -D WITH_CUDA=OFF .. &&
    7. make -j`nproc --all` &&
    8. sudo make install
  • Install Caffe v1.0RC5, commands are for CPU_ONLY version
    1. wget https://github.com/BVLC/caffe/archive/rc5.zip &&
    2. unzip rc5.zip &&
    3. cd caffe-rc5 &&
    4. cp Makefile.config.example Makefile.config &&
    5. sed -i 's\# CPU_ONLY := 1\CPU_ONLY := 1\' Makefile.config &&
    6. sed -i 's\# USE_OPENCV := 0\USE_OPENCV := 1\' Makefile.config &&
    7. sed -i 's\# OPENCV_VERSION := 3\OPENCV_VERSION := 3\' Makefile.config &&
    8. sed -i 's\DISTRIBUTE_DIR := distribute\DISTRIBUTE_DIR := /usr/local/caffe' Makefile.config &&
    9. make all -j`nproc --all` &&
    10. sudo make distribute
  • Clone and compile project
    1. git clone https://github.com/alessandrozamberletti/Caffe-Classification.git &&
    2. cd Caffe-Classification &&
    3. make all &&
    4. ./dist/Release/GNU-Linux/caffe-classification

References

Caffe Deep learning framework
SqueezeNet: AlexNet-level accuracy with 50x fewer parameters
OpenCV: Open Source Computer Vision Library