Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection #13

Open
wants to merge 1,092 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1092 commits
Select commit Hold shift + click to select a range
0b389ee
minor fixes
Jul 6, 2015
58b114f
List protobuf-compiler dependency in the correct place (it is in the …
semitrivial Jul 7, 2015
d7407af
imported video data layer
Jul 7, 2015
a08bfb5
Fix CMake typos
lukeyeager Jul 8, 2015
ead0392
add fixed corner crop support.
Jul 8, 2015
f539b25
add fixed corner crop support.
Jul 8, 2015
b583a4c
Merge remote-tracking branch 'origin/data_parallel' into action_recog
Jul 8, 2015
582499e
Update README.md
yjxiong Jul 8, 2015
b41dd87
Merge pull request #2716 from lukeyeager/cmake-typos
shelhamer Jul 8, 2015
7093b0b
Making the net_spec python3 compatible
philkr Jul 7, 2015
96179ca
Merge pull request #2714 from philkr/python3_netspec
longjon Jul 8, 2015
a97b976
Update README.md
yjxiong Jul 9, 2015
e8a5c4c
Update README.md
yjxiong Jul 9, 2015
0e2d7a8
Update README.md
yjxiong Jul 10, 2015
1ef277c
Update README.md
yjxiong Jul 10, 2015
4f008e0
Update README.md
yjxiong Jul 10, 2015
ff4e286
Merge pull request #2712 from semitrivial/master
jeffdonahue Jul 10, 2015
3eb1332
experimental multi-scale cropping support.
Jul 9, 2015
b993fda
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
Jul 10, 2015
c5a0e95
Merge remote-tracking branch 'origin/data_parallel' into action_recog
Jul 10, 2015
b2742ca
multi-scale bug fix
Jul 10, 2015
0c2b994
Merge remote-tracking branch 'upstream/master'
Jul 10, 2015
99b4f51
Merge branch 'master' into data_parallel
Jul 10, 2015
4ef1979
multi-scale bug fix
Jul 10, 2015
00013c7
Merge remote-tracking branch 'origin/data_parallel' into action_recog
Jul 11, 2015
e481636
multi-scale bug fix
Jul 11, 2015
99c67b4
add corner crop and multiscale
Jul 12, 2015
6950c42
Merge remote-tracking branch 'origin/data_parallel' into action_recog
Jul 12, 2015
8d54662
Update README.md
yjxiong Jul 12, 2015
d6120bc
remove redundant cropping settings.
Jul 12, 2015
c7815f9
resolve conlict of multi-scale and mean file
Jul 12, 2015
8fbff97
Update README.md
yjxiong Jul 14, 2015
305ce56
Update README.md
yjxiong Jul 14, 2015
6e4ced0
Merge remote-tracking branch 'origin/data_parallel' into action_recog
wanglimin Jul 28, 2015
d7aea0b
add is_flow in data_tranformer layer
Jul 29, 2015
9a9e249
modified gather_layer
Jul 29, 2015
0716374
solve the confict
Jul 29, 2015
ec7b130
add configurable multiscale
Jul 30, 2015
470b58f
Merge remote-tracking branch 'origin/data_parallel' into action_recog
lmwang9527 Jul 30, 2015
3e9d3df
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
lmwang9527 Jul 31, 2015
ba03b68
resolve merge issues
lmwang9527 Jul 31, 2015
c02f6a1
add example of training very deep two-stream cnns
Aug 2, 2015
7377a6d
releasing UCF101 model and configurations.
Aug 3, 2015
0f59fd3
releasing UCF101 model and configurations.
Aug 3, 2015
1607d0d
releasing UCF101 temporal model and configurations.
Aug 3, 2015
13a392e
finish releasing UCF101 models.
Aug 3, 2015
97a32d0
added proejct site for ucf101 report.
Aug 3, 2015
f77895b
fix typo
Aug 3, 2015
1ce0fb8
Update README.md
yjxiong Aug 3, 2015
0e7fae6
Update train_action_recognition_flow.sh
yjxiong Aug 3, 2015
175c0d3
Update train_action_recognition_rgb.sh
yjxiong Aug 3, 2015
af00258
Update vgg_16_rgb_train_val_fast.prototxt
Aug 6, 2015
8a16357
Update vgg_16_flow_train_val_fast.prototxt
Aug 6, 2015
c55174e
Update readme.md
yjxiong Aug 7, 2015
e41bca5
add matlab test code for action recognition
Aug 11, 2015
bea2d3d
fix demo.m
Aug 11, 2015
62eb43f
update rbg_mean.mat
Aug 11, 2015
4e4f862
caffe's trial GPU initialization conflict with exclusive mode.
Aug 11, 2015
bef1459
Merge branch 'data_parallel' into action_recog
Aug 11, 2015
fdc32ff
fix rgb_mean.mat
Aug 11, 2015
3c4ea49
Merge remote-tracking branch 'origin/action_recog' into action_recog
Aug 11, 2015
98494fd
solve testing issues
Aug 14, 2015
84e80ab
Merge branch 'data_parallel' into action_recog
Aug 14, 2015
c6f9c47
Update README.md
yjxiong Aug 14, 2015
7e974de
experimental batch normalization
lxx1991 Aug 19, 2015
33af902
initial implementation finished.
Aug 26, 2015
fbbd635
background comm implemented. Incorrect perforamance.
Aug 26, 2015
6f58275
cp
Aug 26, 2015
8cd6459
results corrected. locking conflict solved.
Aug 31, 2015
aa35a08
Update vgg_16_rgb_train_val_fast.prototxt
Sep 1, 2015
3f30c78
possible memleak. iter_size issue
Sep 1, 2015
b01756e
Update vgg_16_flow_train_val_fast.prototxt
Sep 1, 2015
dfd2333
Update vgg_16_rgb_train_val_fast.prototxt
Sep 1, 2015
18608b6
memleak resolved. wrapped code in USE_MPI macro
Sep 1, 2015
a4ef029
remove redundant code
Sep 1, 2015
99ef931
no need for boost 1.55 for now
Sep 1, 2015
ac821ab
mpi_thread_serialized works properly with current ver.
Sep 3, 2015
218f1d7
Merge branch 'bg_comm' into data_parallel
Sep 7, 2015
91ee558
Squashed commit of the following:
Sep 7, 2015
ac117ad
Merge remote-tracking branch 'origin/action_recog' into action_recog
Sep 7, 2015
4fafa60
Update README.md
yjxiong Sep 7, 2015
5547704
Update README.md
yjxiong Sep 7, 2015
411f38d
Update README.md
yjxiong Sep 8, 2015
bda5241
Update data_transformer.cpp
Sep 9, 2015
4598606
Update data_transformer.cpp
Sep 9, 2015
b08c711
Update README.md
yjxiong Sep 9, 2015
e111b0a
Update README.md
yjxiong Sep 11, 2015
f5ea4ef
fix Gather layer bug when USE_MPI is disabled.
Sep 14, 2015
990a729
Merge branch 'data_parallel' into action_recog
Sep 14, 2015
032ef41
Merge remote-tracking branch 'origin/action_recog' into action_recog
Sep 14, 2015
0a03a24
add "exp10" lr_policy
Sep 17, 2015
72a886a
within-shard shuffle implemented.
Sep 17, 2015
77169c4
minor fixes
Sep 18, 2015
69944ad
minor fixes
Sep 18, 2015
354ca5e
lr_policy typo
Sep 18, 2015
31d2f55
disable openmpi cuda api: occasional data corruption.
Sep 18, 2015
e3fefd2
initial upgrade to cudnnv3, fwd only
Sep 23, 2015
a61e075
supported cudnn_v3
Sep 24, 2015
ff4e486
Merge branch 'cudnn3' into action_recog
Sep 24, 2015
6206e6a
Update README.md
yjxiong Sep 24, 2015
3b53d5c
reduce cuDNN mem consumption in Testing.
Sep 25, 2015
d121be0
Merge remote-tracking branch 'origin/action_recog' into action_recog
Sep 25, 2015
f0f1dc3
Update README.md
yjxiong Sep 30, 2015
b4c7435
Update README.md
yjxiong Sep 30, 2015
2e6c2fa
refine crop/scale code
Oct 5, 2015
88cd584
add scatter layer and related logics
Oct 7, 2015
fe2c9cd
add more cropping options
Oct 8, 2015
b08cfe8
try to fix cudnn buffer allocation
Oct 9, 2015
96a7236
Merge branch 'action_recog' into data_parallel
Oct 10, 2015
c38a5bd
refactored cudnn wrapper.
Oct 10, 2015
10f17bf
Update README.md
yjxiong Oct 13, 2015
4cdc768
add normalize, smoothL1Loss layers
Oct 16, 2015
e5f5a37
Merge remote-tracking branch 'origin/action_recog' into action_recog
Oct 16, 2015
99449d8
add frozen state to bn for finetuning on small dataset.
Oct 19, 2015
2d3945c
expose phase to python layer
Oct 20, 2015
a1585e1
force releasing opencv mat
Oct 22, 2015
c30c998
minor change
Oct 22, 2015
09ceecf
add python prefetch thread registry
Nov 11, 2015
868b3c6
finish prefetch cpp side
Nov 11, 2015
a444264
Update README.md
yjxiong Nov 13, 2015
ec7ee95
Update README.md
yjxiong Nov 13, 2015
214bfee
python layer prefetch tested
Nov 14, 2015
b864508
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
Nov 19, 2015
03ed316
remove redundant logging
Nov 19, 2015
c402f23
remove faulty include
Nov 19, 2015
fb43a7b
Update README.md
yjxiong Nov 23, 2015
db9fabe
fix testing bug when crop_size not specified
Dec 1, 2015
b739b97
Fix CuDNNConvolutionLayer for cuDNN v4
flx42 Dec 10, 2015
fb0c5da
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
Dec 15, 2015
0eee271
Add cudnn BN
Cysu Dec 16, 2015
0ade90d
Python script to convert original BN models to new ones
Cysu Dec 16, 2015
83d0315
Rename the python script and add a log message
Cysu Dec 16, 2015
15c86f7
Merge pull request #16 from Cysu/cudnn-bn
yjxiong Dec 16, 2015
a309135
Update README.md
yjxiong Dec 17, 2015
f536113
Create CHANGELOG.md
yjxiong Dec 17, 2015
b5d15a1
Update README.md
yjxiong Dec 17, 2015
9d3f308
Find the best cudnn conv algorithm during runtime
Cysu Dec 20, 2015
31a3bca
Choose the best cudnn conv algo that satisfies the workspace memory l…
Cysu Dec 21, 2015
c1339de
Fix a bug
Cysu Dec 21, 2015
ec26910
Merge pull request #18 from Cysu/cudnn-find-algo
yjxiong Dec 22, 2015
c263c06
add gloable runtime optimizaiton for cudnn conv
Dec 22, 2015
1e2e358
minor fix for stable optimiz
Dec 23, 2015
8a61e5c
change mem_tick design
Dec 23, 2015
d017226
fix zero richness
Dec 23, 2015
e34037b
fix zero richness
Dec 23, 2015
be6306e
change default richness setting
Dec 23, 2015
69f1b6d
Merge pull request #19 from yjxiong/runtime_optim_cudnn
yjxiong Dec 23, 2015
b927156
Minor change
yjxiong Dec 23, 2015
e4b9c40
Update README.md
yjxiong Dec 23, 2015
5fa731c
Update CHANGELOG.md
yjxiong Dec 23, 2015
08e8033
Remove earlier updates
yjxiong Dec 23, 2015
10ee85e
Update README.md
yjxiong Dec 23, 2015
5fdfd26
Update README.md
yjxiong Dec 23, 2015
d0677f4
Update CHANGELOG.md
yjxiong Dec 23, 2015
06dc7be
correction of cudnn_conv_layer.cpp
wanglimin Dec 23, 2015
5b9ba73
enable travis ci
Dec 23, 2015
c5c5d50
enable travis ci
Dec 23, 2015
fa59f0a
fix travis build
Dec 23, 2015
991bdcd
fix travis
Dec 23, 2015
876042e
fix travis compile failure
Dec 23, 2015
7aafb2a
disable lint on travis
Dec 23, 2015
31536b8
cannot run make runtime on travis with CUDA
Dec 23, 2015
cc38aa2
Merge pull request #20 from yjxiong/travis
yjxiong Dec 24, 2015
efa1289
Update README.md
yjxiong Dec 24, 2015
e061fd2
fix restart crash by removing global reference.
Dec 30, 2015
973c5d6
Merge pull request #22 from yjxiong/fix/cudnn_lib_crash
yjxiong Dec 30, 2015
b1f5620
Switch back to CAFFE engine when freeze BN
Cysu Jan 4, 2016
e56d172
Merge pull request #24 from Cysu/cudnn-bn
yjxiong Jan 4, 2016
742ed61
Fix the bug that BN running mean and std have weight decay by default
Cysu Jan 4, 2016
79f7451
Merge pull request #25 from Cysu/cudnn-bn
yjxiong Jan 4, 2016
6dd11ea
Generate BN inference model
Cysu Jan 4, 2016
f4ebd91
Freeze the BN layer when cannot be absorbed
Cysu Jan 5, 2016
a418398
Merge pull request #26 from Cysu/cudnn-bn
yjxiong Jan 5, 2016
f25b523
Python wrappers for temporal/spatial prediction
Jan 7, 2016
f34a16c
added keyword arguments
Jan 8, 2016
67904d0
Merge pull request #28 from chuckcho/action_recog_python_wrapper
yjxiong Jan 14, 2016
241f7fd
Fix the checking of shared param
Cysu Jan 14, 2016
ba053c9
Merge pull request #32 from Cysu/fix-shared-param
yjxiong Jan 14, 2016
e1de4fd
Update vgg_16_rgb_train_val_fast.prototxt
wanglimin Jan 16, 2016
aec55f8
Update vgg_16_flow_train_val_fast.prototxt
wanglimin Jan 16, 2016
2fe7caa
Update README.md
yjxiong Jan 18, 2016
89bc738
fallback to caffe's BN engine for accuracy issue.
Feb 2, 2016
a25a24b
Update data_transformer.cpp
wanglimin Feb 17, 2016
2767017
Update data_transformer.cpp
wanglimin Feb 17, 2016
bbedb27
Fix bugs in CUDNN BN layer
Cysu Feb 19, 2016
b4fc873
Merge pull request #47 from Cysu/fix-cudnn-bn
Cysu Feb 19, 2016
203f24d
Sync loss when test
Cysu Feb 24, 2016
6ed67a1
Merge pull request #48 from Cysu/fix-test-sync-loss
yjxiong Feb 25, 2016
4f99d7e
Update VideoSpatialPrediction.py
yjxiong Feb 29, 2016
36bc68a
fix broken tests with cuDNN
Feb 29, 2016
d8568ae
add support for ROIPooling layers
Feb 29, 2016
eacddc5
Merge pull request #50 from yjxiong/fix/cudnn_test
yjxiong Feb 29, 2016
3d04a73
guard roi pooling tests with GPU only macro
Feb 29, 2016
9d1a274
Merge branch 'action_recog' of github.com:yjxiong/caffe into roi_pool…
Feb 29, 2016
3ce4495
Merge pull request #51 from yjxiong/roi_pooling_layers
yjxiong Feb 29, 2016
5a23d79
Update README.md
yjxiong Feb 29, 2016
a5cc263
add scale and bias layers
Mar 5, 2016
1ea015c
add scale and bias layers
Mar 5, 2016
02c496e
Update video_data_layer.cpp
wanglimin Mar 7, 2016
c2622fc
add batch red layer
Mar 8, 2016
e629d3e
bread tested
Mar 8, 2016
51adf35
add gpu implementation
Mar 9, 2016
c9ae4f1
set zero
Mar 10, 2016
e7ed649
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
Mar 21, 2016
20f6070
add custom file patterns for video data.
Mar 30, 2016
e0292c8
Update travis_install.sh
yjxiong Mar 30, 2016
473c9f5
Update travis_install.sh
yjxiong Mar 30, 2016
6fa6382
fix cpu build
Mar 30, 2016
a4c0c8b
new reduction options.
Apr 14, 2016
6bd56ae
fix bugs when the video has only frame
Apr 15, 2016
8a44477
init cudnn_v5 support
Apr 25, 2016
a1bd9af
Fix cudnn bn implementation
Cysu Apr 26, 2016
04495ed
cpu bn changes. cudnn frozen support.
Apr 26, 2016
6baf2e8
remove older bn related changes.
Apr 26, 2016
686e1bc
Fix frozen backward
Cysu Apr 26, 2016
0074a02
Unit test for BN and cudnn BN layers
Cysu Apr 26, 2016
82737f5
update bn_convert script
Apr 27, 2016
de7eb2e
typo
Apr 27, 2016
e2ebce1
typo
Apr 27, 2016
f519bcf
add epsilon option
Apr 27, 2016
2f14344
enable google-style data augmentation.
Apr 27, 2016
89777d9
Cudnn v5 Support (#71)
yjxiong Apr 27, 2016
026da79
Add BN style option for gen_bn_inference
Cysu Apr 28, 2016
77d0cf6
use our BN engine in frozen model
Apr 28, 2016
ed2cc56
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into …
Apr 28, 2016
a15058b
init mem optimizer
May 10, 2016
201fcd3
fix share diff cases.
May 10, 2016
c12d530
share conv buffer and use fastest mode
May 7, 2016
5fd5910
Merge remote-tracking branch 'origin/bread' into new_anet
May 17, 2016
fe898dd
fix topk bug
Apr 18, 2016
331349f
fix snapshot and mem opt time
May 18, 2016
b67600b
Update solver.cpp to fix the duplicate snapshot (#78)
Cysu May 20, 2016
eca349b
Merge remote-tracking branch 'origin/action_recog' into anet
May 20, 2016
8d9fca8
improve mem
May 20, 2016
f02f23e
Update README.md
yjxiong Jun 10, 2016
b301fa0
Improve the python interface (#80)
Cysu Jun 15, 2016
b5e2b3c
Update README.md
yjxiong Jul 16, 2016
823a7c7
Reuse data memory if not propagate down (#86)
Cysu Jul 20, 2016
be90db6
readme and comments
Jul 20, 2016
3721b02
Merge remote-tracking branch 'origin/org_size_processing' into mem
Jul 20, 2016
34665f5
more comments
Jul 20, 2016
c0d6a03
Update README.md (#95)
ae86208 Jul 29, 2016
587df4d
Update README.md
yjxiong Jul 30, 2016
42b9db8
add TOC
yjxiong Jul 30, 2016
c0d200b
fix cudnn conv legacy bug (#96)
yjxiong Aug 4, 2016
70cb98d
Merge branch 'action_recog' into mem
Aug 4, 2016
f971cdb
Merge branch 'action_recog' of https://github.com/yjxiong/caffe into mem
Aug 4, 2016
4506029
standardize memory optimization configurations (#99)
yjxiong Aug 11, 2016
f1fb673
Split MPI comm by specified groups (#101)
Cysu Sep 2, 2016
08c6c8c
untrimmednet push
wanglimin Aug 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 35 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,29 @@
# Compiled MATLAB
*.mex*

# build, distribute, and bins
build
.build_debug/*
.build_release/*
distribute/*
*.testbin
*.bin
python/caffe/proto/
# IPython notebook checkpoints
.ipynb_checkpoints

# Editor temporaries
*.swp
*~

# IPython notebook checkpoints
.ipynb_checkpoints
# Sublime Text settings
*.sublime-workspace
*.sublime-project

# Eclipse Project settings
*.*project
.settings

# QtCreator files
*.user

# PyCharm files
.idea

# OSX dir files
.DS_Store

## Caffe

Expand All @@ -58,13 +66,16 @@ models/*
*leveldb
*lmdb

# LevelDB files
*.sst
*.ldb
LOCK
LOG*
CURRENT
MANIFEST-*
# build, distribute, and bins (+ python proto bindings)
build
.build_debug/*
.build_release/*
distribute/*
*.testbin
*.bin
python/caffe/proto/
cmake_build
.cmake_build

# Generated documentation
docs/_site
Expand All @@ -73,12 +84,10 @@ _site
doxygen
docs/dev

# Sublime Text settings
*.sublime-workspace
*.sublime-project

# Eclipse Project settings
*.*project

# CMake generated files
*.gen.cmake
# LevelDB files
*.sst
*.ldb
LOCK
LOG*
CURRENT
MANIFEST-*
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
# one using CMake, and one using make.
env:
matrix:
- WITH_CUDA=false WITH_CMAKE=false
- WITH_CUDA=false WITH_CMAKE=true
- WITH_CUDA=true WITH_CMAKE=false
- WITH_CUDA=true WITH_CMAKE=true

language: cpp

# Cache Ubuntu apt packages.
cache: apt
cache:
apt: true
directories:
- /home/travis/miniconda

compiler: gcc

Expand All @@ -22,7 +23,8 @@ install:
- sudo -E $SCRIPTS/travis_install.sh

before_script:
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/cuda/lib64
- export PATH=/home/travis/miniconda/bin:$PATH
- if ! $WITH_CMAKE; then $SCRIPTS/travis_setup_makefile_config.sh; fi

script: $SCRIPTS/travis_build_and_test.sh
Expand All @@ -34,7 +36,7 @@ notifications:
# your Caffe fork. To configure your git email address, use:
# git config --global user.email [email protected]
email:
on_success: always
on_success: change
on_failure: always

# IRC notifications disabled by default.
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Apr 27, 2016

Features:

- Supported cuDNN v5
- Use the cuDNN's BatchNormalization implementation as the default engine for BN layer
- BN layer will now store running variance in its fourth blob.
- the script `python/bn_convert_style.py` is added to help converting the bn style forth and back.

## Dec 23, 2015

Features:

- Implemented a planning algorithm to globally optimize the cudnn workspace consumption and speed trade-off.
- Now `richness` parameter specifies the total memory in MBs available to cudnn for convolution workspaces.
- Now the framework will try to find the best convolution algorithm combinations under memory limit.

## Dec 17, 2015

Features:

- cuDNN v4 support
- 20% overall speed gain with faster convolution and batch normalization
- the native batch normalization is changed to comply with cuDNN. Use the script `python/bn_var_to_inv_std.py` to upgrade your models.

## Nov 22, 2015

Features:
- python layer can expose a prefetch() method, which will be run in parallel with network processing.

## Oct 13, 2015

Features:
- Improved cuDNN wrapper to use less GPU memory.
- Now there is a new parameter `richness` which controls the limit of workspace for cuDNN.

## Sep 30, 2015

Features:
- Support for cuDNN v3.

## Sep. 7, 2015

Features:
- New mechanism for parallel comminucation reduced parallel overhead.
- Batch normalization, courtesy of @Cysu.

## Jul, 2015

Features:
- Action recognition tools, scripts, and examples.
- Basic parallel training support
- Various extra data augmentations
121 changes: 51 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,90 +1,71 @@
cmake_minimum_required(VERSION 2.8.8)
project( Caffe )
cmake_minimum_required(VERSION 2.8.7)

### Build Options ##########################################################################
# ---[ Caffe project
project(Caffe C CXX)

option(CPU_ONLY "Build Caffe without GPU support" OFF)
option(BUILD_PYTHON "Build Python wrapper" OFF)
option(BUILD_MATLAB "Build Matlab wrapper" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_SHARED_LIBS "Build SHARED libs if ON and STATIC otherwise" OFF)
# ---[ Using cmake scripts and modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)

if(NOT BLAS)
set(BLAS atlas)
endif()
include(ExternalProject)

if(NOT CUDA_TEST_DEVICE)
set(CUDA_TEST_DEVICE -1)
endif()
include(cmake/Utils.cmake)
include(cmake/Targets.cmake)
include(cmake/Misc.cmake)
include(cmake/Summary.cmake)
include(cmake/ConfigGen.cmake)

# Install Prefix
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install path" FORCE )
endif()
# ---[ Options
caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF NOT CPU_ONLY)
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
caffe_option(BUILD_python "Build Python wrapper" ON)
set(python_version "2" CACHE STRING "Specify which python version to use")
caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
caffe_option(BUILD_python_layer "Build the Caffe python layer" ON)

caffe_option(USE_MPI "whether to include MPI parallelization" OFF) #Used to switch on and off MPI

### Configuration ###########################################################################
# Compiler Flags
set(CMAKE_CXX_COMPILER_FLAGS ${CMAKE_CXX_COMPILER_FLAGS} -Wall)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fPIC) # set global flags
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # set debug flags
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) # set release flags
# ---[ Dependencies
include(cmake/Dependencies.cmake)

# Global Definitions
if(CPU_ONLY)
add_definitions(-DCPU_ONLY)
# ---[ Flags
if(UNIX OR APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")
endif()

# Include Directories
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include)
include_directories(${${PROJECT_NAME}_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/src)
if(USE_libstdcpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
message("-- Warning: forcing libstdc++ (controlled by USE_libstdcpp option in cmake)")
endif()

# CMake Scripts dir
set(CMAKE_SCRIPT_DIR ${CMAKE_SOURCE_DIR}/CMakeScripts)
add_definitions(-DGTEST_USE_OWN_TR1_TUPLE)

# CMake module path for custom module finding
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SCRIPT_DIR})
# ---[ Warnings
caffe_warnings_disable(CMAKE_CXX_FLAGS -Wno-sign-compare -Wno-uninitialized)

# CUDA is required globally
if(NOT CPU_ONLY)
find_package(CUDA 5.5 REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
endif()
# ---[ Config generation
configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_config.h")

### Subdirectories ##########################################################################
# ---[ Includes
set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
include_directories(${Caffe_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
include_directories(BEFORE src) # This is needed for gtest.

# ---[ Subdirectories
add_subdirectory(src/gtest)
add_subdirectory(src/caffe)
add_subdirectory(tools)
add_subdirectory(examples)
add_subdirectory(python)
add_subdirectory(matlab)
add_subdirectory(docs)

if(BUILD_EXAMPLES)
message(STATUS "Examples enabled")
add_subdirectory(examples)
endif()

if(BUILD_PYTHON)
message(STATUS "Python enabled")
add_subdirectory(python)
endif()

if(BUILD_MATLAB)
message(STATUS "Matlab enabled")
add_subdirectory(matlab)
endif()

### Lint Target Setup ##########################################################################

set(LINT_TARGET lint)
set(LINT_SCRIPT ${CMAKE_SCRIPT_DIR}/lint.cmake)
add_custom_target(
${LINT_TARGET}
COMMAND ${CMAKE_COMMAND} -P ${LINT_SCRIPT}
)

### Install #################################################################################

# Install Includes
file(GLOB folders ${${PROJECT_NAME}_INCLUDE_DIRS}/*)
install(DIRECTORY ${folders} DESTINATION include)
# ---[ Linter target
add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)

# ---[ Configuration summary
caffe_print_configuration_summary()

# ---[ Export configs generation
caffe_generate_export_configs()
28 changes: 0 additions & 28 deletions CMakeScripts/FindLMDB.cmake

This file was deleted.

37 changes: 0 additions & 37 deletions CMakeScripts/FindLevelDB.cmake

This file was deleted.

Loading