• Stars
    star
    375
  • Rank 114,096 (Top 3 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimal runtime core of Caffe, Forward only, GPU support and Memory efficiency.

Mini-Caffe

Build Status Build status

Minimal runtime core of Caffe. This repo is aimed to provide a minimal C++ runtime core for those want to Forward a Caffe model.

What can Mini-Caffe do?

Mini-Caffe only depends on OpenBLAS and protobuf which means you can't train model with Mini-Caffe. It also only supports Forward function which means you can't apply models like neural art style transform that uses Backward function.

Build on Windows

You need a VC compiler to build Mini-Caffe. Visual Studio 2013 Community should be fine. You can download from here.

OpenBLAS

OpenBLAS library is already shipped with the source code, we don't need to compile it. If you want, you could download other version from here. v0.2.14 is used for Mini-Caffe.

protobuf

protobuf is a git submodule in Mini-Caffe, we need to fetch the source code and compile it.

$ git submodule update --init
$ cd 3rdparty/src/protobuf/cmake
$ mkdir build
$ cd build
$ cmake .. -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -G "Visual Studio 12 2013 Win64"

Use protobuf.sln to compile Debug and Release version.

With these two libraries, we can compile Mini-Caffe now. Copy protobuf's include headers and libraries. Generate caffe.pb.h and caffe.pb.cc.

$ copydeps.bat
$ generatepb.bat
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 12 2013 Win64"

Use mini-caffe.sln to compile it.

Build on Linux

Install OpenBLAS and protobuf library through system package manager. Or you can compile OpenBLAS and protobuf by yourself. Then build Mini-Caffe.

$ sudo apt install libopenblas-dev libprotobuf-dev protobuf-compiler
$ ./generatepb.sh
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make -j4

If you don't use Ubuntu, then you may need to install OpenBLAS and protobuf through your system package manager if any.

Build on Mac OSX

Install OpenBLAS and protobuf library through brew.

$ brew install openblas protobuf
$ ./generate.sh
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make -j4

Build for Android

Mini-Caffe now can be cross compiled for Android platform, checkout the document here.

With CUDA and CUDNN support

Install CUDA and cuDNN in your system, then we can compile Mini-Caffe with GPU support. Run CMake command below.

$ cmake .. -DUSE_CUDA=ON -DUSE_CUDNN=ON

Currently we only test mini-caffe on CUDA8.0 with cuDNN5.1 and CUDA9.0 with cuDNN7.1.

With Java support

Install Java and set environment variable JAVA_HOME. Run CMake command below.

$ cmake .. -DUSE_JAVA=ON

With Python support

checkout Python API here, install package via python setup.py install.

How to use Mini-Caffe

To use Mini-Caffe as a library, you may refer to example.

How to profile your network

The Profiler in Mini-Caffe can help you profile your network performance, see docs here.

More Repositories

1

deep-landmark

Predict facial landmarks with Deep CNNs powered by Caffe.
Python
283
star
2

face-alignment-at-3000fps

C++ implementation of Face Alignment at 3000 FPS via Regressing Local Binary Features
C++
197
star
3

JDA

C++ implementation of Joint Cascade Face Detection and Alignment.
C++
185
star
4

mx-lsoftmax

mxnet version of Large-Margin Softmax Loss for Convolutional Neural Networks.
Python
175
star
5

Joint-Face-Detection-and-Alignment

Caffe and Python implementation of Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
Python
101
star
6

OrdinalRegression

Caffe Loss Layer for Ordinal Regression with Multiple Output CNN for Age Estimation.
C++
45
star
7

mini-caffe-example

detect facial landmark with mini-caffe
C++
18
star
8

FashionAI.KPS

My solution to FashionAI Key Points Detection of Apparel.
Python
13
star
9

Apriori

a simple implementation of Apriori algorithm in Python.
Python
12
star
10

WGAN

Play with Wasserstein GAN on MXNet.
Python
10
star
11

jsmnpp

jsmn++ is a tiny json parser embedded in your C++ project for configuration.
C++
8
star
12

QMIBBrowser

a mib browser based on snmp++ and Qt
C
5
star
13

face-alignment-presentation

All materials used in Face Alignment Presentation for MultiMedia Course.
4
star
14

rcpr-annotated

RCPR ไปฃ็ ๆณจ่งฃ
MATLAB
3
star
15

luoyetx.github.io

Resume
CSS
2
star
16

installers

scripts for installing open source tools and libraries from source code. Currently On CentOS
Shell
2
star
17

spider-event

a simple workflow for web crawling
JavaScript
1
star
18

CourseraHW

Homework Code on Coursera
MATLAB
1
star