├── .github └── issue_template.md ├── .gitignore ├── 3rdparty ├── Versions.txt ├── caffe │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS.md │ ├── INSTALL.md │ ├── LICENSE │ ├── Makefile │ ├── Makefile.config.Ubuntu14_cuda7.example │ ├── Makefile.config.Ubuntu14_cuda8.example │ ├── Makefile.config.Ubuntu16_cuda7.example │ ├── Makefile.config.Ubuntu16_cuda8.example │ ├── README.md │ ├── caffe.cloc │ ├── cmake │ │ ├── ConfigGen.cmake │ │ ├── Cuda.cmake │ │ ├── Dependencies.cmake │ │ ├── External │ │ │ ├── gflags.cmake │ │ │ └── glog.cmake │ │ ├── Misc.cmake │ │ ├── Modules │ │ │ ├── FindAtlas.cmake │ │ │ ├── FindGFlags.cmake │ │ │ ├── FindGlog.cmake │ │ │ ├── FindLAPACK.cmake │ │ │ ├── FindLMDB.cmake │ │ │ ├── FindLevelDB.cmake │ │ │ ├── FindMKL.cmake │ │ │ ├── FindMatlabMex.cmake │ │ │ ├── FindNCCL.cmake │ │ │ ├── FindNumPy.cmake │ │ │ ├── FindOpenBLAS.cmake │ │ │ ├── FindSnappy.cmake │ │ │ └── FindvecLib.cmake │ │ ├── ProtoBuf.cmake │ │ ├── Summary.cmake │ │ ├── Targets.cmake │ │ ├── Templates │ │ │ ├── CaffeConfig.cmake.in │ │ │ ├── CaffeConfigVersion.cmake.in │ │ │ └── caffe_config.h.in │ │ ├── Uninstall.cmake.in │ │ ├── Utils.cmake │ │ └── lint.cmake │ ├── docker │ │ ├── README.md │ │ ├── cpu │ │ │ └── Dockerfile │ │ └── gpu │ │ │ └── Dockerfile │ ├── docs │ │ ├── CMakeLists.txt │ │ ├── CNAME │ │ ├── README.md │ │ ├── _config.yml │ │ ├── _layouts │ │ │ └── default.html │ │ ├── development.md │ │ ├── images │ │ │ ├── GitHub-Mark-64px.png │ │ │ └── caffeine-icon.png │ │ ├── index.md │ │ ├── install_apt.md │ │ ├── install_apt_debian.md │ │ ├── install_osx.md │ │ ├── install_yum.md │ │ ├── installation.md │ │ ├── model_zoo.md │ │ ├── multigpu.md │ │ ├── stylesheets │ │ │ ├── pygment_trac.css │ │ │ ├── reset.css │ │ │ └── styles.css │ │ └── tutorial │ │ │ ├── convolution.md │ │ │ ├── data.md │ │ │ ├── fig │ │ │ ├── .gitignore │ │ │ ├── backward.jpg │ │ │ ├── forward.jpg │ │ │ ├── forward_backward.png │ │ │ ├── layer.jpg │ │ │ └── logreg.jpg │ │ │ ├── forward_backward.md │ │ │ ├── index.md │ │ │ ├── interfaces.md │ │ │ ├── layers.md │ │ │ ├── layers │ │ │ ├── absval.md │ │ │ ├── accuracy.md │ │ │ ├── argmax.md │ │ │ ├── batchnorm.md │ │ │ ├── batchreindex.md │ │ │ ├── bias.md │ │ │ ├── bnll.md │ │ │ ├── concat.md │ │ │ ├── contrastiveloss.md │ │ │ ├── convolution.md │ │ │ ├── crop.md │ │ │ ├── data.md │ │ │ ├── deconvolution.md │ │ │ ├── dropout.md │ │ │ ├── dummydata.md │ │ │ ├── eltwise.md │ │ │ ├── elu.md │ │ │ ├── embed.md │ │ │ ├── euclideanloss.md │ │ │ ├── exp.md │ │ │ ├── filter.md │ │ │ ├── flatten.md │ │ │ ├── hdf5data.md │ │ │ ├── hdf5output.md │ │ │ ├── hingeloss.md │ │ │ ├── im2col.md │ │ │ ├── imagedata.md │ │ │ ├── infogainloss.md │ │ │ ├── innerproduct.md │ │ │ ├── input.md │ │ │ ├── log.md │ │ │ ├── lrn.md │ │ │ ├── lstm.md │ │ │ ├── memorydata.md │ │ │ ├── multinomiallogisticloss.md │ │ │ ├── mvn.md │ │ │ ├── parameter.md │ │ │ ├── pooling.md │ │ │ ├── power.md │ │ │ ├── prelu.md │ │ │ ├── python.md │ │ │ ├── recurrent.md │ │ │ ├── reduction.md │ │ │ ├── relu.md │ │ │ ├── reshape.md │ │ │ ├── rnn.md │ │ │ ├── scale.md │ │ │ ├── sigmoid.md │ │ │ ├── sigmoidcrossentropyloss.md │ │ │ ├── silence.md │ │ │ ├── slice.md │ │ │ ├── softmax.md │ │ │ ├── softmaxwithloss.md │ │ │ ├── split.md │ │ │ ├── spp.md │ │ │ ├── tanh.md │ │ │ ├── threshold.md │ │ │ ├── tile.md │ │ │ └── windowdata.md │ │ │ ├── loss.md │ │ │ ├── net_layer_blob.md │ │ │ └── solver.md │ ├── examples │ │ ├── 00-classification.ipynb │ │ ├── 01-learning-lenet.ipynb │ │ ├── 02-fine-tuning.ipynb │ │ ├── CMakeLists.txt │ │ ├── brewing-logreg.ipynb │ │ ├── cifar10 │ │ │ ├── cifar10_full.prototxt │ │ │ ├── cifar10_full_sigmoid_solver.prototxt │ │ │ ├── cifar10_full_sigmoid_solver_bn.prototxt │ │ │ ├── cifar10_full_sigmoid_train_test.prototxt │ │ │ ├── cifar10_full_sigmoid_train_test_bn.prototxt │ │ │ ├── cifar10_full_solver.prototxt │ │ │ ├── cifar10_full_solver_lr1.prototxt │ │ │ ├── cifar10_full_solver_lr2.prototxt │ │ │ ├── cifar10_full_train_test.prototxt │ │ │ ├── cifar10_quick.prototxt │ │ │ ├── cifar10_quick_solver.prototxt │ │ │ ├── cifar10_quick_solver_lr1.prototxt │ │ │ ├── cifar10_quick_train_test.prototxt │ │ │ ├── convert_cifar_data.cpp │ │ │ ├── create_cifar10.sh │ │ │ ├── readme.md │ │ │ ├── train_full.sh │ │ │ ├── train_full_sigmoid.sh │ │ │ ├── train_full_sigmoid_bn.sh │ │ │ └── train_quick.sh │ │ ├── cpp_classification │ │ │ ├── classification.cpp │ │ │ └── readme.md │ │ ├── detection.ipynb │ │ ├── feature_extraction │ │ │ ├── imagenet_val.prototxt │ │ │ └── readme.md │ │ ├── finetune_flickr_style │ │ │ ├── assemble_data.py │ │ │ ├── flickr_style.csv.gz │ │ │ ├── readme.md │ │ │ └── style_names.txt │ │ ├── finetune_pascal_detection │ │ │ ├── pascal_finetune_solver.prototxt │ │ │ └── pascal_finetune_trainval_test.prototxt │ │ ├── hdf5_classification │ │ │ ├── nonlinear_auto_test.prototxt │ │ │ ├── nonlinear_auto_train.prototxt │ │ │ ├── nonlinear_train_val.prototxt │ │ │ └── train_val.prototxt │ │ ├── imagenet │ │ │ ├── create_imagenet.sh │ │ │ ├── make_imagenet_mean.sh │ │ │ ├── readme.md │ │ │ ├── resume_training.sh │ │ │ └── train_caffenet.sh │ │ ├── images │ │ │ ├── cat gray.jpg │ │ │ ├── cat.jpg │ │ │ ├── cat_gray.jpg │ │ │ └── fish-bike.jpg │ │ ├── mnist │ │ │ ├── convert_mnist_data.cpp │ │ │ ├── create_mnist.sh │ │ │ ├── lenet.prototxt │ │ │ ├── lenet_adadelta_solver.prototxt │ │ │ ├── lenet_auto_solver.prototxt │ │ │ ├── lenet_consolidated_solver.prototxt │ │ │ ├── lenet_multistep_solver.prototxt │ │ │ ├── lenet_solver.prototxt │ │ │ ├── lenet_solver_adam.prototxt │ │ │ ├── lenet_solver_rmsprop.prototxt │ │ │ ├── lenet_train_test.prototxt │ │ │ ├── mnist_autoencoder.prototxt │ │ │ ├── mnist_autoencoder_solver.prototxt │ │ │ ├── mnist_autoencoder_solver_adadelta.prototxt │ │ │ ├── mnist_autoencoder_solver_adagrad.prototxt │ │ │ ├── mnist_autoencoder_solver_nesterov.prototxt │ │ │ ├── readme.md │ │ │ ├── train_lenet.sh │ │ │ ├── train_lenet_adam.sh │ │ │ ├── train_lenet_consolidated.sh │ │ │ ├── train_lenet_docker.sh │ │ │ ├── train_lenet_rmsprop.sh │ │ │ ├── train_mnist_autoencoder.sh │ │ │ ├── train_mnist_autoencoder_adadelta.sh │ │ │ ├── train_mnist_autoencoder_adagrad.sh │ │ │ └── train_mnist_autoencoder_nesterov.sh │ │ ├── net_surgery.ipynb │ │ ├── net_surgery │ │ │ ├── bvlc_caffenet_full_conv.prototxt │ │ │ └── conv.prototxt │ │ ├── pascal-multilabel-with-datalayer.ipynb │ │ ├── pycaffe │ │ │ ├── caffenet.py │ │ │ ├── layers │ │ │ │ ├── pascal_multilabel_datalayers.py │ │ │ │ └── pyloss.py │ │ │ ├── linreg.prototxt │ │ │ └── tools.py │ │ ├── siamese │ │ │ ├── convert_mnist_siamese_data.cpp │ │ │ ├── create_mnist_siamese.sh │ │ │ ├── mnist_siamese.ipynb │ │ │ ├── mnist_siamese.prototxt │ │ │ ├── mnist_siamese_solver.prototxt │ │ │ ├── mnist_siamese_train_test.prototxt │ │ │ ├── readme.md │ │ │ └── train_mnist_siamese.sh │ │ └── web_demo │ │ │ ├── app.py │ │ │ ├── exifutil.py │ │ │ ├── readme.md │ │ │ ├── requirements.txt │ │ │ └── templates │ │ │ └── index.html │ ├── include │ │ └── caffe │ │ │ ├── blob.hpp │ │ │ ├── caffe.hpp │ │ │ ├── common.hpp │ │ │ ├── data_transformer.hpp │ │ │ ├── filler.hpp │ │ │ ├── internal_thread.hpp │ │ │ ├── layer.hpp │ │ │ ├── layer_factory.hpp │ │ │ ├── layers │ │ │ ├── absval_layer.hpp │ │ │ ├── accuracy_layer.hpp │ │ │ ├── argmax_layer.hpp │ │ │ ├── base_conv_layer.hpp │ │ │ ├── base_data_layer.hpp │ │ │ ├── batch_norm_layer.hpp │ │ │ ├── batch_reindex_layer.hpp │ │ │ ├── bias_layer.hpp │ │ │ ├── bnll_layer.hpp │ │ │ ├── concat_layer.hpp │ │ │ ├── contrastive_loss_layer.hpp │ │ │ ├── conv_layer.hpp │ │ │ ├── crop_layer.hpp │ │ │ ├── cudnn_conv_layer.hpp │ │ │ ├── cudnn_lcn_layer.hpp │ │ │ ├── cudnn_lrn_layer.hpp │ │ │ ├── cudnn_pooling_layer.hpp │ │ │ ├── cudnn_relu_layer.hpp │ │ │ ├── cudnn_sigmoid_layer.hpp │ │ │ ├── cudnn_softmax_layer.hpp │ │ │ ├── cudnn_tanh_layer.hpp │ │ │ ├── data_layer.hpp │ │ │ ├── deconv_layer.hpp │ │ │ ├── dropout_layer.hpp │ │ │ ├── dummy_data_layer.hpp │ │ │ ├── eltwise_layer.hpp │ │ │ ├── elu_layer.hpp │ │ │ ├── embed_layer.hpp │ │ │ ├── euclidean_loss_layer.hpp │ │ │ ├── exp_layer.hpp │ │ │ ├── filter_layer.hpp │ │ │ ├── flatten_layer.hpp │ │ │ ├── hdf5_data_layer.hpp │ │ │ ├── hdf5_output_layer.hpp │ │ │ ├── hinge_loss_layer.hpp │ │ │ ├── im2col_layer.hpp │ │ │ ├── image_data_layer.hpp │ │ │ ├── infogain_loss_layer.hpp │ │ │ ├── inner_product_layer.hpp │ │ │ ├── input_layer.hpp │ │ │ ├── log_layer.hpp │ │ │ ├── loss_layer.hpp │ │ │ ├── lrn_layer.hpp │ │ │ ├── lstm_layer.hpp │ │ │ ├── memory_data_layer.hpp │ │ │ ├── multinomial_logistic_loss_layer.hpp │ │ │ ├── mvn_layer.hpp │ │ │ ├── neuron_layer.hpp │ │ │ ├── parameter_layer.hpp │ │ │ ├── pooling_layer.hpp │ │ │ ├── power_layer.hpp │ │ │ ├── prelu_layer.hpp │ │ │ ├── python_layer.hpp │ │ │ ├── recurrent_layer.hpp │ │ │ ├── reduction_layer.hpp │ │ │ ├── relu_layer.hpp │ │ │ ├── reshape_layer.hpp │ │ │ ├── rnn_layer.hpp │ │ │ ├── scale_layer.hpp │ │ │ ├── sigmoid_cross_entropy_loss_layer.hpp │ │ │ ├── sigmoid_layer.hpp │ │ │ ├── silence_layer.hpp │ │ │ ├── slice_layer.hpp │ │ │ ├── softmax_layer.hpp │ │ │ ├── softmax_loss_layer.hpp │ │ │ ├── split_layer.hpp │ │ │ ├── spp_layer.hpp │ │ │ ├── tanh_layer.hpp │ │ │ ├── threshold_layer.hpp │ │ │ ├── tile_layer.hpp │ │ │ └── window_data_layer.hpp │ │ │ ├── net.hpp │ │ │ ├── parallel.hpp │ │ │ ├── sgd_solvers.hpp │ │ │ ├── solver.hpp │ │ │ ├── solver_factory.hpp │ │ │ ├── syncedmem.hpp │ │ │ ├── test │ │ │ ├── test_caffe_main.hpp │ │ │ └── test_gradient_check_util.hpp │ │ │ └── util │ │ │ ├── benchmark.hpp │ │ │ ├── blocking_queue.hpp │ │ │ ├── cudnn.hpp │ │ │ ├── db.hpp │ │ │ ├── db_leveldb.hpp │ │ │ ├── db_lmdb.hpp │ │ │ ├── device_alternate.hpp │ │ │ ├── format.hpp │ │ │ ├── gpu_util.cuh │ │ │ ├── hdf5.hpp │ │ │ ├── im2col.hpp │ │ │ ├── insert_splits.hpp │ │ │ ├── io.hpp │ │ │ ├── math_functions.hpp │ │ │ ├── mkl_alternate.hpp │ │ │ ├── nccl.hpp │ │ │ ├── rng.hpp │ │ │ ├── signal_handler.h │ │ │ └── upgrade_proto.hpp │ ├── install_caffe_if_cuda8.sh │ ├── matlab │ │ ├── +caffe │ │ │ ├── +test │ │ │ │ ├── test_io.m │ │ │ │ ├── test_net.m │ │ │ │ └── test_solver.m │ │ │ ├── Blob.m │ │ │ ├── Layer.m │ │ │ ├── Net.m │ │ │ ├── Solver.m │ │ │ ├── get_net.m │ │ │ ├── get_solver.m │ │ │ ├── imagenet │ │ │ │ └── ilsvrc_2012_mean.mat │ │ │ ├── io.m │ │ │ ├── private │ │ │ │ ├── CHECK.m │ │ │ │ ├── CHECK_FILE_EXIST.m │ │ │ │ ├── caffe_.cpp │ │ │ │ └── is_valid_handle.m │ │ │ ├── reset_all.m │ │ │ ├── run_tests.m │ │ │ ├── set_device.m │ │ │ ├── set_mode_cpu.m │ │ │ ├── set_mode_gpu.m │ │ │ └── version.m │ │ ├── CMakeLists.txt │ │ ├── demo │ │ │ └── classification_demo.m │ │ └── hdf5creation │ │ │ ├── .gitignore │ │ │ ├── demo.m │ │ │ └── store2hdf5.m │ ├── python │ │ ├── CMakeLists.txt │ │ ├── caffe │ │ │ ├── __init__.py │ │ │ ├── _caffe.cpp │ │ │ ├── classifier.py │ │ │ ├── coord_map.py │ │ │ ├── detector.py │ │ │ ├── draw.py │ │ │ ├── imagenet │ │ │ │ └── ilsvrc_2012_mean.npy │ │ │ ├── io.py │ │ │ ├── net_spec.py │ │ │ ├── proto │ │ │ │ └── __init__.py │ │ │ ├── pycaffe.py │ │ │ └── test │ │ │ │ ├── test_coord_map.py │ │ │ │ ├── test_draw.py │ │ │ │ ├── test_io.py │ │ │ │ ├── test_layer_type_list.py │ │ │ │ ├── test_nccl.py │ │ │ │ ├── test_net.py │ │ │ │ ├── test_net_spec.py │ │ │ │ ├── test_python_layer.py │ │ │ │ ├── test_python_layer_with_param_str.py │ │ │ │ └── test_solver.py │ │ ├── classify.py │ │ ├── detect.py │ │ ├── draw_net.py │ │ ├── requirements.txt │ │ └── train.py │ ├── scripts │ │ ├── build_docs.sh │ │ ├── caffe │ │ ├── copy_notebook.py │ │ ├── cpp_lint.py │ │ ├── deploy_docs.sh │ │ ├── download_model_binary.py │ │ ├── download_model_from_gist.sh │ │ ├── gather_examples.sh │ │ ├── split_caffe_proto.py │ │ ├── travis │ │ │ ├── build.sh │ │ │ ├── configure-cmake.sh │ │ │ ├── configure-make.sh │ │ │ ├── configure.sh │ │ │ ├── defaults.sh │ │ │ ├── install-deps.sh │ │ │ ├── install-python-deps.sh │ │ │ ├── setup-venv.sh │ │ │ └── test.sh │ │ └── upload_model_to_gist.sh │ ├── src │ │ ├── caffe │ │ │ ├── CMakeLists.txt │ │ │ ├── blob.cpp │ │ │ ├── common.cpp │ │ │ ├── data_transformer.cpp │ │ │ ├── internal_thread.cpp │ │ │ ├── layer.cpp │ │ │ ├── layer_factory.cpp │ │ │ ├── layers │ │ │ │ ├── absval_layer.cpp │ │ │ │ ├── absval_layer.cu │ │ │ │ ├── accuracy_layer.cpp │ │ │ │ ├── argmax_layer.cpp │ │ │ │ ├── base_conv_layer.cpp │ │ │ │ ├── base_data_layer.cpp │ │ │ │ ├── base_data_layer.cu │ │ │ │ ├── batch_norm_layer.cpp │ │ │ │ ├── batch_norm_layer.cu │ │ │ │ ├── batch_reindex_layer.cpp │ │ │ │ ├── batch_reindex_layer.cu │ │ │ │ ├── bias_layer.cpp │ │ │ │ ├── bias_layer.cu │ │ │ │ ├── bnll_layer.cpp │ │ │ │ ├── bnll_layer.cu │ │ │ │ ├── concat_layer.cpp │ │ │ │ ├── concat_layer.cu │ │ │ │ ├── contrastive_loss_layer.cpp │ │ │ │ ├── contrastive_loss_layer.cu │ │ │ │ ├── conv_layer.cpp │ │ │ │ ├── conv_layer.cu │ │ │ │ ├── crop_layer.cpp │ │ │ │ ├── crop_layer.cu │ │ │ │ ├── cudnn_conv_layer.cpp │ │ │ │ ├── cudnn_conv_layer.cu │ │ │ │ ├── cudnn_lcn_layer.cpp │ │ │ │ ├── cudnn_lcn_layer.cu │ │ │ │ ├── cudnn_lrn_layer.cpp │ │ │ │ ├── cudnn_lrn_layer.cu │ │ │ │ ├── cudnn_pooling_layer.cpp │ │ │ │ ├── cudnn_pooling_layer.cu │ │ │ │ ├── cudnn_relu_layer.cpp │ │ │ │ ├── cudnn_relu_layer.cu │ │ │ │ ├── cudnn_sigmoid_layer.cpp │ │ │ │ ├── cudnn_sigmoid_layer.cu │ │ │ │ ├── cudnn_softmax_layer.cpp │ │ │ │ ├── cudnn_softmax_layer.cu │ │ │ │ ├── cudnn_tanh_layer.cpp │ │ │ │ ├── cudnn_tanh_layer.cu │ │ │ │ ├── data_layer.cpp │ │ │ │ ├── deconv_layer.cpp │ │ │ │ ├── deconv_layer.cu │ │ │ │ ├── dropout_layer.cpp │ │ │ │ ├── dropout_layer.cu │ │ │ │ ├── dummy_data_layer.cpp │ │ │ │ ├── eltwise_layer.cpp │ │ │ │ ├── eltwise_layer.cu │ │ │ │ ├── elu_layer.cpp │ │ │ │ ├── elu_layer.cu │ │ │ │ ├── embed_layer.cpp │ │ │ │ ├── embed_layer.cu │ │ │ │ ├── euclidean_loss_layer.cpp │ │ │ │ ├── euclidean_loss_layer.cu │ │ │ │ ├── exp_layer.cpp │ │ │ │ ├── exp_layer.cu │ │ │ │ ├── filter_layer.cpp │ │ │ │ ├── filter_layer.cu │ │ │ │ ├── flatten_layer.cpp │ │ │ │ ├── hdf5_data_layer.cpp │ │ │ │ ├── hdf5_data_layer.cu │ │ │ │ ├── hdf5_output_layer.cpp │ │ │ │ ├── hdf5_output_layer.cu │ │ │ │ ├── hinge_loss_layer.cpp │ │ │ │ ├── im2col_layer.cpp │ │ │ │ ├── im2col_layer.cu │ │ │ │ ├── image_data_layer.cpp │ │ │ │ ├── infogain_loss_layer.cpp │ │ │ │ ├── inner_product_layer.cpp │ │ │ │ ├── inner_product_layer.cu │ │ │ │ ├── input_layer.cpp │ │ │ │ ├── log_layer.cpp │ │ │ │ ├── log_layer.cu │ │ │ │ ├── loss_layer.cpp │ │ │ │ ├── lrn_layer.cpp │ │ │ │ ├── lrn_layer.cu │ │ │ │ ├── lstm_layer.cpp │ │ │ │ ├── lstm_unit_layer.cpp │ │ │ │ ├── lstm_unit_layer.cu │ │ │ │ ├── memory_data_layer.cpp │ │ │ │ ├── multinomial_logistic_loss_layer.cpp │ │ │ │ ├── mvn_layer.cpp │ │ │ │ ├── mvn_layer.cu │ │ │ │ ├── neuron_layer.cpp │ │ │ │ ├── parameter_layer.cpp │ │ │ │ ├── pooling_layer.cpp │ │ │ │ ├── pooling_layer.cu │ │ │ │ ├── power_layer.cpp │ │ │ │ ├── power_layer.cu │ │ │ │ ├── prelu_layer.cpp │ │ │ │ ├── prelu_layer.cu │ │ │ │ ├── recurrent_layer.cpp │ │ │ │ ├── recurrent_layer.cu │ │ │ │ ├── reduction_layer.cpp │ │ │ │ ├── reduction_layer.cu │ │ │ │ ├── relu_layer.cpp │ │ │ │ ├── relu_layer.cu │ │ │ │ ├── reshape_layer.cpp │ │ │ │ ├── rnn_layer.cpp │ │ │ │ ├── scale_layer.cpp │ │ │ │ ├── scale_layer.cu │ │ │ │ ├── sigmoid_cross_entropy_loss_layer.cpp │ │ │ │ ├── sigmoid_cross_entropy_loss_layer.cu │ │ │ │ ├── sigmoid_layer.cpp │ │ │ │ ├── sigmoid_layer.cu │ │ │ │ ├── silence_layer.cpp │ │ │ │ ├── silence_layer.cu │ │ │ │ ├── slice_layer.cpp │ │ │ │ ├── slice_layer.cu │ │ │ │ ├── softmax_layer.cpp │ │ │ │ ├── softmax_layer.cu │ │ │ │ ├── softmax_loss_layer.cpp │ │ │ │ ├── softmax_loss_layer.cu │ │ │ │ ├── split_layer.cpp │ │ │ │ ├── split_layer.cu │ │ │ │ ├── spp_layer.cpp │ │ │ │ ├── tanh_layer.cpp │ │ │ │ ├── tanh_layer.cu │ │ │ │ ├── threshold_layer.cpp │ │ │ │ ├── threshold_layer.cu │ │ │ │ ├── tile_layer.cpp │ │ │ │ ├── tile_layer.cu │ │ │ │ └── window_data_layer.cpp │ │ │ ├── net.cpp │ │ │ ├── parallel.cpp │ │ │ ├── proto │ │ │ │ └── caffe.proto │ │ │ ├── solver.cpp │ │ │ ├── solvers │ │ │ │ ├── adadelta_solver.cpp │ │ │ │ ├── adadelta_solver.cu │ │ │ │ ├── adagrad_solver.cpp │ │ │ │ ├── adagrad_solver.cu │ │ │ │ ├── adam_solver.cpp │ │ │ │ ├── adam_solver.cu │ │ │ │ ├── nesterov_solver.cpp │ │ │ │ ├── nesterov_solver.cu │ │ │ │ ├── rmsprop_solver.cpp │ │ │ │ ├── rmsprop_solver.cu │ │ │ │ ├── sgd_solver.cpp │ │ │ │ └── sgd_solver.cu │ │ │ ├── syncedmem.cpp │ │ │ ├── test │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── test_accuracy_layer.cpp │ │ │ │ ├── test_argmax_layer.cpp │ │ │ │ ├── test_batch_norm_layer.cpp │ │ │ │ ├── test_batch_reindex_layer.cpp │ │ │ │ ├── test_benchmark.cpp │ │ │ │ ├── test_bias_layer.cpp │ │ │ │ ├── test_blob.cpp │ │ │ │ ├── test_caffe_main.cpp │ │ │ │ ├── test_common.cpp │ │ │ │ ├── test_concat_layer.cpp │ │ │ │ ├── test_contrastive_loss_layer.cpp │ │ │ │ ├── test_convolution_layer.cpp │ │ │ │ ├── test_crop_layer.cpp │ │ │ │ ├── test_data │ │ │ │ │ ├── generate_sample_data.py │ │ │ │ │ ├── sample_data.h5 │ │ │ │ │ ├── sample_data_2_gzip.h5 │ │ │ │ │ ├── sample_data_list.txt │ │ │ │ │ ├── solver_data.h5 │ │ │ │ │ └── solver_data_list.txt │ │ │ │ ├── test_data_layer.cpp │ │ │ │ ├── test_data_transformer.cpp │ │ │ │ ├── test_db.cpp │ │ │ │ ├── test_deconvolution_layer.cpp │ │ │ │ ├── test_dummy_data_layer.cpp │ │ │ │ ├── test_eltwise_layer.cpp │ │ │ │ ├── test_embed_layer.cpp │ │ │ │ ├── test_euclidean_loss_layer.cpp │ │ │ │ ├── test_filler.cpp │ │ │ │ ├── test_filter_layer.cpp │ │ │ │ ├── test_flatten_layer.cpp │ │ │ │ ├── test_gradient_based_solver.cpp │ │ │ │ ├── test_hdf5_output_layer.cpp │ │ │ │ ├── test_hdf5data_layer.cpp │ │ │ │ ├── test_hinge_loss_layer.cpp │ │ │ │ ├── test_im2col_kernel.cu │ │ │ │ ├── test_im2col_layer.cpp │ │ │ │ ├── test_image_data_layer.cpp │ │ │ │ ├── test_infogain_loss_layer.cpp │ │ │ │ ├── test_inner_product_layer.cpp │ │ │ │ ├── test_internal_thread.cpp │ │ │ │ ├── test_io.cpp │ │ │ │ ├── test_layer_factory.cpp │ │ │ │ ├── test_lrn_layer.cpp │ │ │ │ ├── test_lstm_layer.cpp │ │ │ │ ├── test_math_functions.cpp │ │ │ │ ├── test_maxpool_dropout_layers.cpp │ │ │ │ ├── test_memory_data_layer.cpp │ │ │ │ ├── test_multinomial_logistic_loss_layer.cpp │ │ │ │ ├── test_mvn_layer.cpp │ │ │ │ ├── test_net.cpp │ │ │ │ ├── test_neuron_layer.cpp │ │ │ │ ├── test_platform.cpp │ │ │ │ ├── test_pooling_layer.cpp │ │ │ │ ├── test_power_layer.cpp │ │ │ │ ├── test_protobuf.cpp │ │ │ │ ├── test_random_number_generator.cpp │ │ │ │ ├── test_reduction_layer.cpp │ │ │ │ ├── test_reshape_layer.cpp │ │ │ │ ├── test_rnn_layer.cpp │ │ │ │ ├── test_scale_layer.cpp │ │ │ │ ├── test_sigmoid_cross_entropy_loss_layer.cpp │ │ │ │ ├── test_slice_layer.cpp │ │ │ │ ├── test_softmax_layer.cpp │ │ │ │ ├── test_softmax_with_loss_layer.cpp │ │ │ │ ├── test_solver.cpp │ │ │ │ ├── test_solver_factory.cpp │ │ │ │ ├── test_split_layer.cpp │ │ │ │ ├── test_spp_layer.cpp │ │ │ │ ├── test_stochastic_pooling.cpp │ │ │ │ ├── test_syncedmem.cpp │ │ │ │ ├── test_tanh_layer.cpp │ │ │ │ ├── test_threshold_layer.cpp │ │ │ │ ├── test_tile_layer.cpp │ │ │ │ ├── test_upgrade_proto.cpp │ │ │ │ └── test_util_blas.cpp │ │ │ └── util │ │ │ │ ├── benchmark.cpp │ │ │ │ ├── blocking_queue.cpp │ │ │ │ ├── cudnn.cpp │ │ │ │ ├── db.cpp │ │ │ │ ├── db_leveldb.cpp │ │ │ │ ├── db_lmdb.cpp │ │ │ │ ├── hdf5.cpp │ │ │ │ ├── im2col.cpp │ │ │ │ ├── im2col.cu │ │ │ │ ├── insert_splits.cpp │ │ │ │ ├── io.cpp │ │ │ │ ├── math_functions.cpp │ │ │ │ ├── math_functions.cu │ │ │ │ ├── signal_handler.cpp │ │ │ │ └── upgrade_proto.cpp │ │ └── gtest │ │ │ ├── CMakeLists.txt │ │ │ ├── gtest-all.cpp │ │ │ ├── gtest.h │ │ │ └── gtest_main.cc │ └── tools │ │ ├── CMakeLists.txt │ │ ├── caffe.cpp │ │ ├── compute_image_mean.cpp │ │ ├── convert_imageset.cpp │ │ ├── device_query.cpp │ │ ├── extra │ │ ├── extract_seconds.py │ │ ├── launch_resize_and_crop_images.sh │ │ ├── parse_log.py │ │ ├── parse_log.sh │ │ ├── plot_log.gnuplot.example │ │ ├── plot_training_log.py.example │ │ ├── resize_and_crop_images.py │ │ └── summarize.py │ │ ├── extract_features.cpp │ │ ├── finetune_net.cpp │ │ ├── net_speed_benchmark.cpp │ │ ├── test_net.cpp │ │ ├── train_net.cpp │ │ ├── upgrade_net_proto_binary.cpp │ │ ├── upgrade_net_proto_text.cpp │ │ └── upgrade_solver_proto_text.cpp └── windows │ ├── getCaffe.bat │ ├── getCaffe3rdparty.bat │ ├── getOpenCV.bat │ ├── unzip │ ├── LICENSE.txt │ └── unzip.exe │ └── wget │ ├── COPYING │ ├── Version_wget-1.19.1-win64.txt │ ├── wget.exe │ ├── wget.exe.debug │ ├── wget.html │ └── wget.ini.sample ├── LICENSE ├── Makefile ├── README.md ├── doc ├── GUI_help │ ├── GUI_help.odt │ └── GUI_help.png ├── UML │ └── 1_0_0rc3 │ │ ├── UML.mdj │ │ ├── UML.pdf │ │ └── UML.png ├── contributors.md ├── demo_overview.md ├── doc_autogeneration.doxygen ├── installation.md ├── library_add_new_module.md ├── library_extend_functionality.md ├── library_overview.md ├── media │ ├── body_heat_maps.png │ ├── dance.gif │ ├── keypoints_face.png │ ├── keypoints_hand.odt │ ├── keypoints_hand.png │ ├── keypoints_pose.png │ ├── openpose3d.png │ ├── paf_heat_maps.png │ ├── pose_face.gif │ ├── pose_face_hands.gif │ ├── pose_hands.gif │ └── shake.gif ├── openpose_3d_reconstruction_demo.md ├── output.md └── release_notes.md ├── examples ├── media │ ├── COCO_val2014_000000000192.jpg │ ├── COCO_val2014_000000000241.jpg │ ├── COCO_val2014_000000000257.jpg │ ├── COCO_val2014_000000000294.jpg │ ├── COCO_val2014_000000000328.jpg │ ├── COCO_val2014_000000000338.jpg │ ├── COCO_val2014_000000000357.jpg │ ├── COCO_val2014_000000000360.jpg │ ├── COCO_val2014_000000000395.jpg │ ├── COCO_val2014_000000000415.jpg │ ├── COCO_val2014_000000000428.jpg │ ├── COCO_val2014_000000000459.jpg │ ├── COCO_val2014_000000000474.jpg │ ├── COCO_val2014_000000000488.jpg │ ├── COCO_val2014_000000000536.jpg │ ├── COCO_val2014_000000000544.jpg │ ├── COCO_val2014_000000000564.jpg │ ├── COCO_val2014_000000000569.jpg │ ├── COCO_val2014_000000000589.jpg │ ├── COCO_val2014_000000000623.jpg │ └── video.avi ├── openpose │ └── openpose.cpp ├── tests │ ├── handFromJsonTest.cpp │ ├── hand_accuracy_test.sh │ ├── pose_accuracy_coco_test.sh │ ├── pose_time_Caffe_layers.sh │ ├── pose_time_visual_GUI.sh │ └── wrapperHandFromJsonTest.hpp ├── tutorial_pose │ ├── 1_extract_from_image.cpp │ └── 2_extract_pose_or_heatmat_from_image.cpp ├── tutorial_thread │ ├── 1_openpose_read_and_display.cpp │ ├── 2_user_processing_function.cpp │ ├── 3_user_input_processing_and_output.cpp │ └── 4_user_input_processing_output_and_datum.cpp ├── tutorial_wrapper │ ├── 1_user_asynchronous.cpp │ └── 2_user_synchronous.cpp └── user_code │ └── User custom files here will compile, try not to modify the CPM source code ├── examples_beta └── openpose3d │ ├── include │ └── openpose3d │ │ ├── cameraParameters.hpp │ │ ├── datum3D.hpp │ │ ├── headers.hpp │ │ ├── pointGrey.hpp │ │ ├── reconstruction3D.hpp │ │ └── renderer.hpp │ ├── openpose3d.cpp │ └── src │ ├── pointGrey.cpp │ ├── reconstruction3D.cpp │ └── renderer.cpp ├── include └── openpose │ ├── core │ ├── array.hpp │ ├── common.hpp │ ├── cvMatToOpInput.hpp │ ├── cvMatToOpOutput.hpp │ ├── datum.hpp │ ├── enumClasses.hpp │ ├── headers.hpp │ ├── keypointScaler.hpp │ ├── macros.hpp │ ├── maximumBase.hpp │ ├── maximumCaffe.hpp │ ├── net.hpp │ ├── netCaffe.hpp │ ├── nmsBase.hpp │ ├── nmsCaffe.hpp │ ├── opOutputToCvMat.hpp │ ├── point.hpp │ ├── rectangle.hpp │ ├── renderer.hpp │ ├── resizeAndMergeBase.hpp │ ├── resizeAndMergeCaffe.hpp │ ├── wCvMatToOpInput.hpp │ ├── wCvMatToOpOutput.hpp │ ├── wKeypointScaler.hpp │ └── wOpOutputToCvMat.hpp │ ├── experimental │ ├── headers.hpp │ └── producer │ │ ├── headers.hpp │ │ └── wPeoplePoseLoader.hpp │ ├── face │ ├── faceDetector.hpp │ ├── faceExtractor.hpp │ ├── faceParameters.hpp │ ├── faceRenderer.hpp │ ├── headers.hpp │ ├── renderFace.hpp │ ├── wFaceDetector.hpp │ ├── wFaceExtractor.hpp │ └── wFaceRenderer.hpp │ ├── filestream │ ├── cocoJsonSaver.hpp │ ├── enumClasses.hpp │ ├── fileSaver.hpp │ ├── fileStream.hpp │ ├── headers.hpp │ ├── heatMapSaver.hpp │ ├── imageSaver.hpp │ ├── jsonOfstream.hpp │ ├── keypointJsonSaver.hpp │ ├── keypointSaver.hpp │ ├── videoSaver.hpp │ ├── wCocoJsonSaver.hpp │ ├── wFaceSaver.hpp │ ├── wHandSaver.hpp │ ├── wHeatMapSaver.hpp │ ├── wImageSaver.hpp │ ├── wKeypointJsonSaver.hpp │ ├── wPoseSaver.hpp │ └── wVideoSaver.hpp │ ├── gui │ ├── enumClasses.hpp │ ├── frameDisplayer.hpp │ ├── gui.hpp │ ├── guiInfoAdder.hpp │ ├── headers.hpp │ ├── wGui.hpp │ └── wGuiInfoAdder.hpp │ ├── hand │ ├── handDetector.hpp │ ├── handDetectorFromTxt.hpp │ ├── handExtractor.hpp │ ├── handParameters.hpp │ ├── handRenderer.hpp │ ├── headers.hpp │ ├── renderHand.hpp │ ├── wHandDetector.hpp │ ├── wHandDetectorFromTxt.hpp │ ├── wHandDetectorTracking.hpp │ ├── wHandDetectorUpdate.hpp │ ├── wHandExtractor.hpp │ └── wHandRenderer.hpp │ ├── headers.hpp │ ├── pose │ ├── bodyPartConnectorBase.hpp │ ├── bodyPartConnectorCaffe.hpp │ ├── enumClasses.hpp │ ├── headers.hpp │ ├── poseExtractor.hpp │ ├── poseExtractorCaffe.hpp │ ├── poseParameters.hpp │ ├── poseRenderer.hpp │ ├── renderPose.hpp │ ├── wPoseExtractor.hpp │ └── wPoseRenderer.hpp │ ├── producer │ ├── datumProducer.hpp │ ├── enumClasses.hpp │ ├── headers.hpp │ ├── imageDirectoryReader.hpp │ ├── producer.hpp │ ├── videoCaptureReader.hpp │ ├── videoReader.hpp │ ├── wDatumProducer.hpp │ └── webcamReader.hpp │ ├── thread │ ├── enumClasses.hpp │ ├── headers.hpp │ ├── priorityQueue.hpp │ ├── queue.hpp │ ├── queueBase.hpp │ ├── subThread.hpp │ ├── subThreadNoQueue.hpp │ ├── subThreadQueueIn.hpp │ ├── subThreadQueueInOut.hpp │ ├── subThreadQueueOut.hpp │ ├── thread.hpp │ ├── threadManager.hpp │ ├── wIdGenerator.hpp │ ├── wQueueOrderer.hpp │ ├── worker.hpp │ ├── workerConsumer.hpp │ └── workerProducer.hpp │ ├── utilities │ ├── check.hpp │ ├── cuda.hpp │ ├── cuda.hu │ ├── enumClasses.hpp │ ├── errorAndLog.hpp │ ├── fastMath.hpp │ ├── fileSystem.hpp │ ├── flagsToOpenPose.hpp │ ├── headers.hpp │ ├── keypoint.hpp │ ├── openCv.hpp │ ├── pointerContainer.hpp │ ├── profiler.hpp │ ├── render.hu │ └── string.hpp │ └── wrapper │ ├── headers.hpp │ ├── wrapper.hpp │ ├── wrapperStructFace.hpp │ ├── wrapperStructHand.hpp │ ├── wrapperStructInput.hpp │ ├── wrapperStructOutput.hpp │ └── wrapperStructPose.hpp ├── models ├── face │ └── pose_deploy.prototxt ├── getModels.bat ├── getModels.sh ├── hand │ └── pose_deploy.prototxt └── pose │ ├── coco │ └── pose_deploy_linevec.prototxt │ └── mpi │ ├── pose_deploy_linevec.prototxt │ └── pose_deploy_linevec_faster_4_stages.prototxt ├── src └── openpose │ ├── core │ ├── array.cpp │ ├── cvMatToOpInput.cpp │ ├── cvMatToOpOutput.cpp │ ├── datum.cpp │ ├── defineTemplates.cpp │ ├── keypointScaler.cpp │ ├── maximumBase.cpp │ ├── maximumBase.cu │ ├── maximumCaffe.cpp │ ├── netCaffe.cpp │ ├── nmsBase.cpp │ ├── nmsBase.cu │ ├── nmsCaffe.cpp │ ├── opOutputToCvMat.cpp │ ├── point.cpp │ ├── rectangle.cpp │ ├── renderer.cpp │ ├── resizeAndMergeBase.cpp │ ├── resizeAndMergeBase.cu │ └── resizeAndMergeCaffe.cpp │ ├── face │ ├── defineTemplates.cpp │ ├── faceDetector.cpp │ ├── faceExtractor.cpp │ ├── faceRenderer.cpp │ ├── renderFace.cpp │ └── renderFace.cu │ ├── filestream │ ├── cocoJsonSaver.cpp │ ├── defineTemplates.cpp │ ├── fileSaver.cpp │ ├── fileStream.cpp │ ├── heatMapSaver.cpp │ ├── imageSaver.cpp │ ├── jsonOfstream.cpp │ ├── keypointJsonSaver.cpp │ ├── keypointSaver.cpp │ └── videoSaver.cpp │ ├── gui │ ├── defineTemplates.cpp │ ├── frameDisplayer.cpp │ ├── gui.cpp │ └── guiInfoAdder.cpp │ ├── hand │ ├── defineTemplates.cpp │ ├── handDetector.cpp │ ├── handDetectorFromTxt.cpp │ ├── handExtractor.cpp │ ├── handRenderer.cpp │ ├── renderHand.cpp │ └── renderHand.cu │ ├── pose │ ├── bodyPartConnectorBase.cpp │ ├── bodyPartConnectorBase.cu │ ├── bodyPartConnectorCaffe.cpp │ ├── defineTemplates.cpp │ ├── poseExtractor.cpp │ ├── poseExtractorCaffe.cpp │ ├── poseParameters.cpp │ ├── poseRenderer.cpp │ ├── renderPose.cpp │ └── renderPose.cu │ ├── producer │ ├── defineTemplates.cpp │ ├── imageDirectoryReader.cpp │ ├── producer.cpp │ ├── videoCaptureReader.cpp │ ├── videoReader.cpp │ └── webcamReader.cpp │ ├── thread │ └── defineTemplates.cpp │ ├── utilities │ ├── cuda.cpp │ ├── errorAndLog.cpp │ ├── fileSystem.cpp │ ├── flagsToOpenPose.cpp │ ├── keypoint.cpp │ ├── openCv.cpp │ ├── profiler.cpp │ └── string.cpp │ └── wrapper │ ├── defineTemplates.cpp │ ├── wrapperStructFace.cpp │ ├── wrapperStructHand.cpp │ ├── wrapperStructInput.cpp │ ├── wrapperStructOutput.cpp │ └── wrapperStructPose.cpp ├── ubuntu ├── Makefile.config.Ubuntu14_cuda7.example ├── Makefile.config.Ubuntu14_cuda8.example ├── Makefile.config.Ubuntu16_cpu.example ├── Makefile.config.Ubuntu16_cuda7.example ├── Makefile.config.Ubuntu16_cuda8.example ├── install_caffe_and_openpose_if_cuda8.sh └── install_openpose_if_cuda8.sh └── windows ├── OpenPose.sln ├── OpenPose ├── OpenPose.vcxproj ├── OpenPose.vcxproj.filters └── OpenPose.vcxproj.user ├── OpenPose3DReconstruction ├── OpenPose3DReconstruction.vcxproj ├── OpenPose3DReconstruction.vcxproj.filters └── OpenPose3DReconstruction.vcxproj.user ├── OpenPoseDemo ├── OpenPoseDemo.vcxproj ├── OpenPoseDemo.vcxproj.filters └── OpenPoseDemo.vcxproj.user ├── TutorialPose ├── 1_extract_from_image.vcxproj ├── 1_extract_from_image.vcxproj.filters ├── 1_extract_from_image.vcxproj.user ├── 2_extract_pose_or_heatmat_from_image.vcxproj ├── 2_extract_pose_or_heatmat_from_image.vcxproj.filters └── 2_extract_pose_or_heatmat_from_image.vcxproj.user ├── TutorialThread ├── 1_openpose_read_and_display.vcxproj ├── 1_openpose_read_and_display.vcxproj.filters ├── 1_openpose_read_and_display.vcxproj.user ├── 2_user_processing_function.vcxproj ├── 2_user_processing_function.vcxproj.filters ├── 2_user_processing_function.vcxproj.user ├── 3_user_input_processing_and_output.vcxproj ├── 3_user_input_processing_and_output.vcxproj.filters ├── 3_user_input_processing_and_output.vcxproj.user ├── 4_user_input_processing_output_and_datum.vcxproj ├── 4_user_input_processing_output_and_datum.vcxproj.filters └── 4_user_input_processing_output_and_datum.vcxproj.user ├── TutorialWrapper ├── 1_user_asynchronous.vcxproj ├── 1_user_asynchronous.vcxproj.filters ├── 1_user_asynchronous.vcxproj.user ├── 2_user_synchronous.vcxproj ├── 2_user_synchronous.vcxproj.filters └── 2_user_synchronous.vcxproj.user └── download_3rdparty_and_models.bat /3rdparty/Versions.txt: -------------------------------------------------------------------------------- 1 | Unix: 2 | - Caffe: 3 | - Version 1.0.0, extracted from GitHub on 07/19/2017 from the current master branch. 4 | - Link: https://github.com/BVLC/caffe 5 | 6 | Windows: 7 | - Caffe & Caffe dependencies (caffe3rdparty): 8 | - Version 1.0.0, extracted from GitHub on 07/11/2017 from the current master branch. 9 | - Link: https://github.com/BVLC/caffe/tree/windows 10 | 11 | - OpenCV: 12 | - Version 3.1.0, extracted from their oficial website, section releases/3.1.0/Win pack. 13 | - Link: http://opencv.org/releases.html 14 | 15 | - Unzip: 16 | - Version 5.52. 17 | - Link: http://stahlworks.com/dev/?tool=zipunzip 18 | 19 | - Wget: 20 | - Version wget-1.19.1-win64. 21 | - Link: https://eternallybored.org/misc/wget/ 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | Caffe is developed by a core set of BAIR members and the open-source community. 4 | 5 | We thank all of our [contributors](https://github.com/BVLC/caffe/graphs/contributors)! 6 | 7 | **For the detailed history of contributions** of a given file, try 8 | 9 | git blame file 10 | 11 | to see line-by-line credits and 12 | 13 | git log --follow file 14 | 15 | to see the change log even across renames and rewrites. 16 | 17 | Please refer to the [acknowledgements](http://caffe.berkeleyvision.org/#acknowledgements) on the Caffe site for further details. 18 | 19 | **Copyright** is held by the original contributor according to the versioning history; see LICENSE. 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | See http://caffe.berkeleyvision.org/installation.html for the latest 4 | installation instructions. 5 | 6 | Check the users group in case you need help: 7 | https://groups.google.com/forum/#!forum/caffe-users 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/cmake/Modules/FindNCCL.cmake: -------------------------------------------------------------------------------- 1 | set(NCCL_INC_PATHS 2 | /usr/include 3 | /usr/local/include 4 | $ENV{NCCL_DIR}/include 5 | ) 6 | 7 | set(NCCL_LIB_PATHS 8 | /lib 9 | /lib64 10 | /usr/lib 11 | /usr/lib64 12 | /usr/local/lib 13 | /usr/local/lib64 14 | $ENV{NCCL_DIR}/lib 15 | ) 16 | 17 | find_path(NCCL_INCLUDE_DIR NAMES nccl.h PATHS ${NCCL_INC_PATHS}) 18 | find_library(NCCL_LIBRARIES NAMES nccl PATHS ${NCCL_LIB_PATHS}) 19 | 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARIES) 22 | 23 | if (NCCL_FOUND) 24 | message(STATUS "Found NCCL (include: ${NCCL_INCLUDE_DIR}, library: ${NCCL_LIBRARIES})") 25 | mark_as_advanced(NCCL_INCLUDE_DIR NCCL_LIBRARIES) 26 | endif () 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/cmake/Templates/CaffeConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@Caffe_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /3rdparty/caffe/cmake/Templates/caffe_config.h.in: -------------------------------------------------------------------------------- 1 | /* Sources directory */ 2 | #define SOURCE_FOLDER "${PROJECT_SOURCE_DIR}" 3 | 4 | /* Binaries directory */ 5 | #define BINARY_FOLDER "${PROJECT_BINARY_DIR}" 6 | 7 | /* This is an absolute path so that we can run test from any build 8 | * directory */ 9 | #define ABS_TEST_DATA_DIR "${PROJECT_SOURCE_DIR}/src/caffe/test/test_data/" 10 | 11 | /* Test device */ 12 | #define CUDA_TEST_DEVICE ${CUDA_TEST_DEVICE} 13 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/CNAME: -------------------------------------------------------------------------------- 1 | caffe.berkeleyvision.org 2 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/README.md: -------------------------------------------------------------------------------- 1 | # Caffe Documentation 2 | 3 | To generate the documentation, run `$CAFFE_ROOT/scripts/build_docs.sh`. 4 | 5 | To push your changes to the documentation to the gh-pages branch of your or the BVLC repo, run `$CAFFE_ROOT/scripts/deploy_docs.sh `. 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/_config.yml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - 3 | scope: 4 | path: "" # an empty string here means all files in the project 5 | values: 6 | layout: "default" 7 | 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/images/GitHub-Mark-64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/images/GitHub-Mark-64px.png -------------------------------------------------------------------------------- /3rdparty/caffe/docs/images/caffeine-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/images/caffeine-icon.png -------------------------------------------------------------------------------- /3rdparty/caffe/docs/stylesheets/reset.css: -------------------------------------------------------------------------------- 1 | /* MeyerWeb Reset */ 2 | 3 | html, body, div, span, applet, object, iframe, 4 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 5 | a, abbr, acronym, address, big, cite, code, 6 | del, dfn, em, img, ins, kbd, q, s, samp, 7 | small, strike, strong, sub, sup, tt, var, 8 | b, u, i, center, 9 | dl, dt, dd, ol, ul, li, 10 | fieldset, form, label, legend, 11 | table, caption, tbody, tfoot, thead, tr, th, td, 12 | article, aside, canvas, details, embed, 13 | figure, figcaption, footer, header, hgroup, 14 | menu, nav, output, ruby, section, summary, 15 | time, mark, audio, video { 16 | margin: 0; 17 | padding: 0; 18 | border: 0; 19 | font: inherit; 20 | vertical-align: baseline; 21 | } 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/convolution.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Convolution 3 | --- 4 | # Caffeinated Convolution 5 | 6 | The Caffe strategy for convolution is to reduce the problem to matrix-matrix multiplication. 7 | This linear algebra computation is highly-tuned in BLAS libraries and efficiently computed on GPU devices. 8 | 9 | For more details read Yangqing's [Convolution in Caffe: a memo](https://github.com/Yangqing/caffe/wiki/Convolution-in-Caffe:-a-memo). 10 | 11 | As it turns out, this same reduction was independently explored in the context of conv. nets by 12 | 13 | > K. Chellapilla, S. Puri, P. Simard, et al. High performance convolutional neural networks for document processing. In Tenth International Workshop on Frontiers in Handwriting Recognition, 2006. 14 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/.gitignore -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/backward.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/backward.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/forward.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/forward.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/forward_backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/forward_backward.png -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/layer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/layer.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/fig/logreg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/docs/tutorial/fig/logreg.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/absval.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Absolute Value Layer 3 | --- 4 | 5 | # Absolute Value Layer 6 | 7 | * Layer type: `AbsVal` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1AbsValLayer.html) 9 | * Header: [`./include/caffe/layers/absval_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/absval_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/absval_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/absval_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/absval_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/absval_layer.cu) 12 | 13 | * Sample 14 | 15 | layer { 16 | name: "layer" 17 | bottom: "in" 18 | top: "out" 19 | type: "AbsVal" 20 | } 21 | 22 | The `AbsVal` layer computes the output as abs(x) for each input element x. 23 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/accuracy.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Accuracy and Top-k 3 | --- 4 | 5 | # Accuracy and Top-k 6 | 7 | `Accuracy` scores the output as the accuracy of output with respect to target -- it is not actually a loss and has no backward step. 8 | 9 | * Layer type: `Accuracy` 10 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1AccuracyLayer.html) 11 | * Header: [`./include/caffe/layers/accuracy_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/accuracy_layer.hpp) 12 | * CPU implementation: [`./src/caffe/layers/accuracy_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/accuracy_layer.cpp) 13 | 14 | ## Parameters 15 | * Parameters (`AccuracyParameter accuracy_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/AccuracyParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/argmax.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ArgMax Layer 3 | --- 4 | 5 | # ArgMax Layer 6 | 7 | * Layer type: `ArgMax` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ArgMaxLayer.html) 9 | * Header: [`./include/caffe/layers/argmax_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/argmax_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/argmax_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/argmax_layer.cpp) 11 | 12 | ## Parameters 13 | * Parameters (`ArgMaxParameter argmax_param`) 14 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 15 | 16 | {% highlight Protobuf %} 17 | {% include proto/ArgMaxParameter.txt %} 18 | {% endhighlight %} 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/batchnorm.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Batch Norm Layer 3 | --- 4 | 5 | # Batch Norm Layer 6 | 7 | * Layer type: `BatchNorm` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BatchNormLayer.html) 9 | * Header: [`./include/caffe/layers/batch_norm_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/batch_norm_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/batch_norm_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_norm_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/batch_norm_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_norm_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`BatchNormParameter batch_norm_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/BatchNormParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/batchreindex.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Batch Reindex Layer 3 | --- 4 | 5 | # Batch Reindex Layer 6 | 7 | * Layer type: `BatchReindex` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BatchReindexLayer.html) 9 | * Header: [`./include/caffe/layers/batch_reindex_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/batch_reindex_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/batch_reindex_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_reindex_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/batch_reindex_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_reindex_layer.cu) 12 | 13 | 14 | ## Parameters 15 | 16 | No parameters. 17 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/bias.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Bias Layer 3 | --- 4 | 5 | # Bias Layer 6 | 7 | * Layer type: `Bias` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BiasLayer.html) 9 | * Header: [`./include/caffe/layers/bias_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/bias_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/bias_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bias_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/bias_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bias_layer.cu) 12 | 13 | ## Parameters 14 | * Parameters (`BiasParameter bias_param`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/BiasParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/bnll.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: BNLL Layer 3 | --- 4 | 5 | # BNLL Layer 6 | 7 | * Layer type: `BNLL` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BNLLLayer.html) 9 | * Header: [`./include/caffe/layers/bnll_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/bnll_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/bnll_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bnll_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/bnll_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bnll_layer.cu) 12 | 13 | The `BNLL` (binomial normal log likelihood) layer computes the output as log(1 + exp(x)) for each input element x. 14 | 15 | ## Parameters 16 | No parameters. 17 | 18 | ## Sample 19 | 20 | layer { 21 | name: "layer" 22 | bottom: "in" 23 | top: "out" 24 | type: BNLL 25 | } 26 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/contrastiveloss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contrastive Loss Layer 3 | --- 4 | 5 | # Contrastive Loss Layer 6 | 7 | * Layer type: `ContrastiveLoss` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ContrastiveLossLayer.html) 9 | * Header: [`./include/caffe/layers/contrastive_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/contrastive_loss_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/contrastive_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/contrastive_loss_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/contrastive_loss_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/contrastive_loss_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`ContrastiveLossParameter contrastive_loss_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/ContrastiveLossParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/crop.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Crop Layer 3 | --- 4 | 5 | # Crop Layer 6 | 7 | * Layer type: `Crop` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1CropLayer.html) 9 | * Header: [`./include/caffe/layers/crop_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/crop_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/crop_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/crop_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/crop_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/crop_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`CropParameter crop_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/CropParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/deconvolution.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Deconvolution Layer 3 | --- 4 | 5 | # Deconvolution Layer 6 | 7 | * Layer type: `Deconvolution` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DeconvolutionLayer.html) 9 | * Header: [`./include/caffe/layers/deconv_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/deconv_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/deconv_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/deconv_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/deconv_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/deconv_layer.cu) 12 | 13 | ## Parameters 14 | 15 | Uses the same parameters as the Convolution layer. 16 | 17 | * Parameters (`ConvolutionParameter convolution_param`) 18 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 19 | 20 | {% highlight Protobuf %} 21 | {% include proto/ConvolutionParameter.txt %} 22 | {% endhighlight %} 23 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/dropout.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dropout Layer 3 | --- 4 | 5 | # Dropout Layer 6 | 7 | * Layer type: `Dropout` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DropoutLayer.html) 9 | * Header: [`./include/caffe/layers/dropout_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/dropout_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/dropout_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dropout_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/dropout_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dropout_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`DropoutParameter dropout_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/DropoutParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/dummydata.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dummy Data Layer 3 | --- 4 | 5 | # Dummy Data Layer 6 | 7 | * Layer type: `DummyData` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DummyDataLayer.html) 9 | * Header: [`./include/caffe/layers/dummy_data_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/dummy_data_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/dummy_data_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dummy_data_layer.cpp) 11 | 12 | 13 | ## Parameters 14 | 15 | * Parameters (`DummyDataParameter dummy_data_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/DummyDataParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/eltwise.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Eltwise Layer 3 | --- 4 | 5 | # Eltwise Layer 6 | 7 | * Layer type: `Eltwise` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1EltwiseLayer.html) 9 | * Header: [`./include/caffe/layers/eltwise_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/eltwise_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/eltwise_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/eltwise_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/eltwise_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/eltwise_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`EltwiseParameter eltwise_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/EltwiseParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/elu.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ELU Layer 3 | --- 4 | 5 | # ELU Layer 6 | 7 | * Layer type: `ELU` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ELULayer.html) 9 | * Header: [`./include/caffe/layers/elu_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/elu_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/elu_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/elu_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/elu_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/elu_layer.cu) 12 | 13 | ## References 14 | 15 | * Clevert, Djork-Arne, Thomas Unterthiner, and Sepp Hochreiter. 16 | "Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)" [arXiv:1511.07289](https://arxiv.org/abs/1511.07289). (2015). 17 | 18 | ## Parameters 19 | 20 | * Parameters (`ELUParameter elu_param`) 21 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 22 | 23 | {% highlight Protobuf %} 24 | {% include proto/ELUParameter.txt %} 25 | {% endhighlight %} 26 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/embed.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Embed Layer 3 | --- 4 | 5 | # Embed Layer 6 | 7 | * Layer type: `Embed` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1EmbedLayer.html) 9 | * Header: [`./include/caffe/layers/embed_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/embed_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/embed_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/embed_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/embed_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/embed_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`EmbedParameter embed_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/EmbedParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/euclideanloss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Euclidean Loss Layer 3 | --- 4 | # Sum-of-Squares / Euclidean Loss Layer 5 | 6 | * Layer type: `EuclideanLoss` 7 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1EuclideanLossLayer.html) 8 | * Header: [`./include/caffe/layers/euclidean_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/euclidean_loss_layer.hpp) 9 | * CPU implementation: [`./src/caffe/layers/euclidean_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/euclidean_loss_layer.cpp) 10 | * CUDA GPU implementation: [`./src/caffe/layers/euclidean_loss_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/euclidean_loss_layer.cu) 11 | 12 | The Euclidean loss layer computes the sum of squares of differences of its two inputs, $$\frac 1 {2N} \sum_{i=1}^N \| x^1_i - x^2_i \|_2^2$$. 13 | 14 | ## Parameters 15 | 16 | Does not take any parameters. 17 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/exp.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Exponential Layer 3 | --- 4 | 5 | # Exponential Layer 6 | 7 | * Layer type: `Exp` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ExpLayer.html) 9 | * Header: [`./include/caffe/layers/exp_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/exp_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/exp_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/exp_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/exp_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/exp_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`Parameter exp_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/ExpParameter.txt %} 20 | {% endhighlight %} 21 | 22 | ## See also 23 | 24 | * [Power layer](power.html) 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/filter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Filter Layer 3 | --- 4 | 5 | # Filter Layer 6 | 7 | * Layer type: `Filter` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1FilterLayer.html) 9 | * Header: [`./include/caffe/layers/filter_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/filter_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/filter_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/filter_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/filter_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/filter_layer.cu) 12 | 13 | ## Parameters 14 | 15 | Does not take any parameters. 16 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/flatten.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Flatten Layer 3 | --- 4 | 5 | # Flatten Layer 6 | 7 | * Layer type: `Flatten` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1FlattenLayer.html) 9 | * Header: [`./include/caffe/layers/flatten_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/flatten_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/flatten_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/flatten_layer.cpp) 11 | 12 | The `Flatten` layer is a utility layer that flattens an input of shape `n * c * h * w` to a simple vector output of shape `n * (c*h*w)`. 13 | 14 | ## Parameters 15 | 16 | * Parameters (`FlattenParameter flatten_param`) 17 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 18 | 19 | {% highlight Protobuf %} 20 | {% include proto/FlattenParameter.txt %} 21 | {% endhighlight %} 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/hdf5data.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: HDF5 Data Layer 3 | --- 4 | 5 | # HDF5 Data Layer 6 | 7 | * Layer type: `HDF5Data` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1HDF5DataLayer.html) 9 | * Header: [`./include/caffe/layers/hdf5_data_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/hdf5_data_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/hdf5_data_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/hdf5_data_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/hdf5_data_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/hdf5_data_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`HDF5DataParameter hdf5_data_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/HDF5DataParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/hingeloss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Hinge Loss Layer 3 | --- 4 | 5 | # Hinge (L1, L2) Loss Layer 6 | 7 | * Layer type: `HingeLoss` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1HingeLossLayer.html) 9 | * Header: [`./include/caffe/layers/hinge_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/hinge_loss_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/hinge_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/hinge_loss_layer.cpp) 11 | 12 | ## Parameters 13 | 14 | * Parameters (`HingeLossParameter hinge_loss_param`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/HingeLossParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/im2col.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Im2col Layer 3 | --- 4 | 5 | # im2col 6 | 7 | * File type: `Im2col` 8 | * Header: [`./include/caffe/layers/im2col_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/im2col_layer.hpp) 9 | * CPU implementation: [`./src/caffe/layers/im2col_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/im2col_layer.cpp) 10 | * CUDA GPU implementation: [`./src/caffe/layers/im2col_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/im2col_layer.cu) 11 | 12 | `Im2col` is a helper for doing the image-to-column transformation that you most 13 | likely do not need to know about. This is used in Caffe's original convolution 14 | to do matrix multiplication by laying out all patches into a matrix. 15 | 16 | 17 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/input.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Input Layer 3 | --- 4 | 5 | # Input Layer 6 | 7 | * Layer type: `Input` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1InputLayer.html) 9 | * Header: [`./include/caffe/layers/input_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/input_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/input_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/input_layer.cpp) 11 | 12 | ## Parameters 13 | 14 | * Parameters (`InputParameter input_param`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/InputParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/log.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Log Layer 3 | --- 4 | 5 | # Log Layer 6 | 7 | * Layer type: `Log` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1LogLayer.html) 9 | * Header: [`./include/caffe/layers/log_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/log_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/log_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/log_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/log_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/log_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`Parameter log_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/LogParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/lstm.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: LSTM Layer 3 | --- 4 | 5 | # LSTM Layer 6 | 7 | * Layer type: `LSTM` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1LSTMLayer.html) 9 | * Header: [`./include/caffe/layers/lstm_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/lstm_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/lstm_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/lstm_layer.cpp) 11 | * CPU implementation (helper): [`./src/caffe/layers/lstm_unit_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/lstm_unit_layer.cpp) 12 | * CUDA GPU implementation (helper): [`./src/caffe/layers/lstm_unit_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/lstm_unit_layer.cu) 13 | 14 | ## Parameters 15 | 16 | * Parameters (`Parameter recurrent_param`) 17 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 18 | 19 | {% highlight Protobuf %} 20 | {% include proto/RecurrentParameter.txt %} 21 | {% endhighlight %} 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/multinomiallogisticloss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Multinomial Logistic Loss Layer 3 | --- 4 | 5 | # Multinomial Logistic Loss Layer 6 | 7 | * Layer type: `MultinomialLogisticLoss` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1MultinomialLogisticLossLayer.html) 9 | * Header: [`./include/caffe/layers/multinomial_logistic_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/multinomial_logistic_loss_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/multinomial_logistic_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/multinomial_logistic_loss_layer.cpp) 11 | 12 | ## Parameters 13 | 14 | * Parameters (`LossParameter loss_param`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/LossParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/mvn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mean-Variance Normalization (MVN) Layer 3 | --- 4 | 5 | # Mean-Variance Normalization (MVN) Layer 6 | 7 | * Layer type: `MVN` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1MVNLayer.html) 9 | * Header: [`./include/caffe/layers/mvn_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/mvn_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/mvn_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/mvn_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/mvn_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/mvn_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`MVNParameter mvn_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/MVNParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/parameter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Parameter Layer 3 | --- 4 | 5 | # Parameter Layer 6 | 7 | * Layer type: `Parameter` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ParameterLayer.html) 9 | * Header: [`./include/caffe/layers/parameter_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/parameter_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/parameter_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/parameter_layer.cpp) 11 | 12 | See [https://github.com/BVLC/caffe/pull/2079](https://github.com/BVLC/caffe/pull/2079). 13 | 14 | ## Parameters 15 | 16 | * Parameters (`ParameterParameter parameter_param`) 17 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 18 | 19 | {% highlight Protobuf %} 20 | {% include proto/ParameterParameter.txt %} 21 | {% endhighlight %} 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/prelu.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PReLU Layer 3 | --- 4 | 5 | # PReLU Layer 6 | 7 | * Layer type: `PReLU` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1PReLULayer.html) 9 | * Header: [`./include/caffe/layers/prelu_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/prelu_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/prelu_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/prelu_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/prelu_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/prelu_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`PReLUParameter prelu_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/PReLUParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/python.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Python Layer 3 | --- 4 | 5 | # Python Layer 6 | 7 | * Layer type: `Python` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1PythonLayer.html) 9 | * Header: [`./include/caffe/layers/python_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/python_layer.hpp) 10 | 11 | The Python layer allows users to add customized layers without modifying the Caffe core code. 12 | 13 | ## Parameters 14 | 15 | * Parameters (`PythonParameter python_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/PythonParameter.txt %} 20 | {% endhighlight %} 21 | 22 | ## Examples and tutorials 23 | 24 | * Simple Euclidean loss example 25 | ** [Python code](https://github.com/BVLC/caffe/blob/master/examples/pycaffe/layers/pyloss.py) 26 | ** [Prototxt](https://github.com/BVLC/caffe/blob/master/examples/pycaffe/linreg.prototxt) 27 | * [Tutorial for writing Python layers with DIGITS](https://github.com/NVIDIA/DIGITS/tree/master/examples/python-layer) 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/recurrent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Recurrent Layer 3 | --- 4 | 5 | # Recurrent Layer 6 | 7 | * Layer type: `Recurrent` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1RecurrentLayer.html) 9 | * Header: [`./include/caffe/layers/recurrent_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/recurrent_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/recurrent_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/recurrent_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/recurrent_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/recurrent_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`RecurrentParameter recurrent_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/RecurrentParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/reduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Reduction Layer 3 | --- 4 | 5 | # Reduction Layer 6 | 7 | * Layer type: `Reduction` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ReductionLayer.html) 9 | * Header: [`./include/caffe/layers/reduction_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/reduction_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/reduction_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/reduction_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/reduction_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/reduction_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`ReductionParameter reduction_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/ReductionParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/rnn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RNN Layer 3 | --- 4 | 5 | # RNN Layer 6 | 7 | * Layer type: `RNN` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1RNNLayer.html) 9 | * Header: [`./include/caffe/layers/rnn_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/rnn_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/rnn_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/rnn_layer.cpp) 11 | 12 | ## Parameters 13 | 14 | * Parameters (`RecurrentParameter recurrent_param`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/RecurrentParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/scale.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Scale Layer 3 | --- 4 | 5 | # Scale Layer 6 | 7 | * Layer type: `Scale` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ScaleLayer.html) 9 | * Header: [`./include/caffe/layers/scale_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/scale_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/scale_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/scale_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/scale_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/scale_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`ScaleParameter scale_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/ScaleParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/sigmoidcrossentropyloss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sigmoid Cross-Entropy Loss Layer 3 | --- 4 | 5 | # Sigmoid Cross-Entropy Loss Layer 6 | 7 | * Layer type: `SigmoidCrossEntropyLoss` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SigmoidCrossEntropyLossLayer.html) 9 | * Header: [`./include/caffe/layers/sigmoid_cross_entropy_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/sigmoid_cross_entropy_loss_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/sigmoid_cross_entropy_loss_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/sigmoid_cross_entropy_loss_layer.cu) 12 | 13 | To-do. 14 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/silence.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Silence Layer 3 | --- 4 | 5 | # Silence Layer 6 | 7 | * Layer type: `Silence` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SilenceLayer.html) 9 | * Header: [`./include/caffe/layers/silence_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/silence_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/silence_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/silence_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/silence_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/silence_layer.cu) 12 | 13 | Silences a blob, so that it is not printed. 14 | 15 | ## Parameters 16 | 17 | No parameters. 18 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/softmax.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Softmax Layer 3 | --- 4 | 5 | # Softmax Layer 6 | 7 | * Layer type: `Softmax` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SoftmaxLayer.html) 9 | * Header: [`./include/caffe/layers/softmax_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/softmax_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/softmax_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/softmax_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/softmax_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/softmax_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`SoftmaxParameter softmax_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/SoftmaxParameter.txt %} 20 | {% endhighlight %} 21 | 22 | ## See also 23 | 24 | * [Softmax loss layer](softmaxwithloss.html) 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/split.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Split Layer 3 | --- 4 | 5 | # Split Layer 6 | 7 | * Layer type: `Split` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SplitLayer.html) 9 | * Header: [`./include/caffe/layers/split_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/split_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/split_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/split_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/split_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/split_layer.cu) 12 | 13 | The `Split` layer is a utility layer that splits an input blob to multiple output blobs. This is used when a blob is fed into multiple output layers. 14 | 15 | ## Parameters 16 | 17 | Does not take any parameters. 18 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/spp.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Spatial Pyramid Pooling Layer 3 | --- 4 | 5 | # Spatial Pyramid Pooling Layer 6 | 7 | * Layer type: `SPP` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SPPLayer.html) 9 | * Header: [`./include/caffe/layers/spp_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/spp_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/spp_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/spp_layer.cpp) 11 | 12 | 13 | ## Parameters 14 | 15 | * Parameters (`SPPParameter spp_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/SPPParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/tanh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TanH Layer 3 | --- 4 | 5 | # TanH Layer 6 | 7 | * Header: [`./include/caffe/layers/tanh_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/tanh_layer.hpp) 8 | * CPU implementation: [`./src/caffe/layers/tanh_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/tanh_layer.cpp) 9 | * CUDA GPU implementation: [`./src/caffe/layers/tanh_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/tanh_layer.cu) 10 | 11 | ## Parameters 12 | 13 | * Parameters (`TanHParameter tanh_param`) 14 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 15 | 16 | {% highlight Protobuf %} 17 | {% include proto/TanHParameter.txt %} 18 | {% endhighlight %} 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/threshold.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Threshold Layer 3 | --- 4 | 5 | # Threshold Layer 6 | 7 | * Header: [`./include/caffe/layers/threshold_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/threshold_layer.hpp) 8 | * CPU implementation: [`./src/caffe/layers/threshold_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/threshold_layer.cpp) 9 | * CUDA GPU implementation: [`./src/caffe/layers/threshold_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/threshold_layer.cu) 10 | 11 | ## Parameters 12 | 13 | * Parameters (`ThresholdParameter threshold_param`) 14 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 15 | 16 | {% highlight Protobuf %} 17 | {% include proto/ThresholdParameter.txt %} 18 | {% endhighlight %} 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/tile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tile Layer 3 | --- 4 | 5 | # Tile Layer 6 | 7 | * Layer type: `Tile` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1TileLayer.html) 9 | * Header: [`./include/caffe/layers/tile_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/tile_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/tile_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/tile_layer.cpp) 11 | * CUDA GPU implementation: [`./src/caffe/layers/tile_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/tile_layer.cu) 12 | 13 | ## Parameters 14 | 15 | * Parameters (`TileParameter tile_param`) 16 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 17 | 18 | {% highlight Protobuf %} 19 | {% include proto/TileParameter.txt %} 20 | {% endhighlight %} 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/docs/tutorial/layers/windowdata.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WindowData Layer 3 | --- 4 | 5 | # WindowData Layer 6 | 7 | * Layer type: `WindowData` 8 | * [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1WindowDataLayer.html) 9 | * Header: [`./include/caffe/layers/window_data_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/window_data_layer.hpp) 10 | * CPU implementation: [`./src/caffe/layers/window_data_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/window_data_layer.cpp) 11 | 12 | ## Parameters 13 | 14 | * Parameters (`WindowDataParameter`) 15 | * From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto): 16 | 17 | {% highlight Protobuf %} 18 | {% include proto/WindowDataParameter.txt %} 19 | {% endhighlight %} 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_full_sigmoid_solver.prototxt: -------------------------------------------------------------------------------- 1 | # reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 2 | # then another factor of 10 after 10 more epochs (5000 iters) 3 | 4 | # The train/test net protocol buffer definition 5 | net: "examples/cifar10/cifar10_full_sigmoid_train_test.prototxt" 6 | # test_iter specifies how many forward passes the test should carry out. 7 | # In the case of CIFAR10, we have test batch size 100 and 100 test iterations, 8 | # covering the full 10,000 testing images. 9 | test_iter: 10 10 | # Carry out testing every 1000 training iterations. 11 | test_interval: 1000 12 | # The base learning rate, momentum and the weight decay of the network. 13 | base_lr: 0.001 14 | momentum: 0.9 15 | #weight_decay: 0.004 16 | # The learning rate policy 17 | lr_policy: "step" 18 | gamma: 1 19 | stepsize: 5000 20 | # Display every 100 iterations 21 | display: 100 22 | # The maximum number of iterations 23 | max_iter: 60000 24 | # snapshot intermediate results 25 | snapshot: 10000 26 | snapshot_prefix: "examples/cifar10_full_sigmoid" 27 | # solver mode: CPU or GPU 28 | solver_mode: GPU 29 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt: -------------------------------------------------------------------------------- 1 | # reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 2 | # then another factor of 10 after 10 more epochs (5000 iters) 3 | 4 | # The train/test net protocol buffer definition 5 | net: "examples/cifar10/cifar10_full_sigmoid_train_test_bn.prototxt" 6 | # test_iter specifies how many forward passes the test should carry out. 7 | # In the case of CIFAR10, we have test batch size 100 and 100 test iterations, 8 | # covering the full 10,000 testing images. 9 | test_iter: 10 10 | # Carry out testing every 1000 training iterations. 11 | test_interval: 1000 12 | # The base learning rate, momentum and the weight decay of the network. 13 | base_lr: 0.001 14 | momentum: 0.9 15 | #weight_decay: 0.004 16 | # The learning rate policy 17 | lr_policy: "step" 18 | gamma: 1 19 | stepsize: 5000 20 | # Display every 100 iterations 21 | display: 100 22 | # The maximum number of iterations 23 | max_iter: 60000 24 | # snapshot intermediate results 25 | snapshot: 10000 26 | snapshot_prefix: "examples/cifar10_full_sigmoid_bn" 27 | # solver mode: CPU or GPU 28 | solver_mode: GPU 29 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_full_solver.prototxt: -------------------------------------------------------------------------------- 1 | # reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 2 | # then another factor of 10 after 10 more epochs (5000 iters) 3 | 4 | # The train/test net protocol buffer definition 5 | net: "examples/cifar10/cifar10_full_train_test.prototxt" 6 | # test_iter specifies how many forward passes the test should carry out. 7 | # In the case of CIFAR10, we have test batch size 100 and 100 test iterations, 8 | # covering the full 10,000 testing images. 9 | test_iter: 100 10 | # Carry out testing every 1000 training iterations. 11 | test_interval: 1000 12 | # The base learning rate, momentum and the weight decay of the network. 13 | base_lr: 0.001 14 | momentum: 0.9 15 | weight_decay: 0.004 16 | # The learning rate policy 17 | lr_policy: "fixed" 18 | # Display every 200 iterations 19 | display: 200 20 | # The maximum number of iterations 21 | max_iter: 60000 22 | # snapshot intermediate results 23 | snapshot: 10000 24 | snapshot_format: HDF5 25 | snapshot_prefix: "examples/cifar10/cifar10_full" 26 | # solver mode: CPU or GPU 27 | solver_mode: GPU 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_full_solver_lr1.prototxt: -------------------------------------------------------------------------------- 1 | # reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 2 | # then another factor of 10 after 10 more epochs (5000 iters) 3 | 4 | # The train/test net protocol buffer definition 5 | net: "examples/cifar10/cifar10_full_train_test.prototxt" 6 | # test_iter specifies how many forward passes the test should carry out. 7 | # In the case of CIFAR10, we have test batch size 100 and 100 test iterations, 8 | # covering the full 10,000 testing images. 9 | test_iter: 100 10 | # Carry out testing every 1000 training iterations. 11 | test_interval: 1000 12 | # The base learning rate, momentum and the weight decay of the network. 13 | base_lr: 0.0001 14 | momentum: 0.9 15 | weight_decay: 0.004 16 | # The learning rate policy 17 | lr_policy: "fixed" 18 | # Display every 200 iterations 19 | display: 200 20 | # The maximum number of iterations 21 | max_iter: 65000 22 | # snapshot intermediate results 23 | snapshot: 5000 24 | snapshot_format: HDF5 25 | snapshot_prefix: "examples/cifar10/cifar10_full" 26 | # solver mode: CPU or GPU 27 | solver_mode: GPU 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_full_solver_lr2.prototxt: -------------------------------------------------------------------------------- 1 | # reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 2 | # then another factor of 10 after 10 more epochs (5000 iters) 3 | 4 | # The train/test net protocol buffer definition 5 | net: "examples/cifar10/cifar10_full_train_test.prototxt" 6 | # test_iter specifies how many forward passes the test should carry out. 7 | # In the case of CIFAR10, we have test batch size 100 and 100 test iterations, 8 | # covering the full 10,000 testing images. 9 | test_iter: 100 10 | # Carry out testing every 1000 training iterations. 11 | test_interval: 1000 12 | # The base learning rate, momentum and the weight decay of the network. 13 | base_lr: 0.00001 14 | momentum: 0.9 15 | weight_decay: 0.004 16 | # The learning rate policy 17 | lr_policy: "fixed" 18 | # Display every 200 iterations 19 | display: 200 20 | # The maximum number of iterations 21 | max_iter: 70000 22 | # snapshot intermediate results 23 | snapshot: 5000 24 | snapshot_format: HDF5 25 | snapshot_prefix: "examples/cifar10/cifar10_full" 26 | # solver mode: CPU or GPU 27 | solver_mode: GPU 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_quick_solver.prototxt: -------------------------------------------------------------------------------- 1 | # reduce the learning rate after 8 epochs (4000 iters) by a factor of 10 2 | 3 | # The train/test net protocol buffer definition 4 | net: "examples/cifar10/cifar10_quick_train_test.prototxt" 5 | # test_iter specifies how many forward passes the test should carry out. 6 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 7 | # covering the full 10,000 testing images. 8 | test_iter: 100 9 | # Carry out testing every 500 training iterations. 10 | test_interval: 500 11 | # The base learning rate, momentum and the weight decay of the network. 12 | base_lr: 0.001 13 | momentum: 0.9 14 | weight_decay: 0.004 15 | # The learning rate policy 16 | lr_policy: "fixed" 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 4000 21 | # snapshot intermediate results 22 | snapshot: 4000 23 | snapshot_prefix: "examples/cifar10/cifar10_quick" 24 | # solver mode: CPU or GPU 25 | solver_mode: GPU 26 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/cifar10_quick_solver_lr1.prototxt: -------------------------------------------------------------------------------- 1 | # reduce the learning rate after 8 epochs (4000 iters) by a factor of 10 2 | 3 | # The train/test net protocol buffer definition 4 | net: "examples/cifar10/cifar10_quick_train_test.prototxt" 5 | # test_iter specifies how many forward passes the test should carry out. 6 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 7 | # covering the full 10,000 testing images. 8 | test_iter: 100 9 | # Carry out testing every 500 training iterations. 10 | test_interval: 500 11 | # The base learning rate, momentum and the weight decay of the network. 12 | base_lr: 0.0001 13 | momentum: 0.9 14 | weight_decay: 0.004 15 | # The learning rate policy 16 | lr_policy: "fixed" 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 5000 21 | # snapshot intermediate results 22 | snapshot: 5000 23 | snapshot_format: HDF5 24 | snapshot_prefix: "examples/cifar10/cifar10_quick" 25 | # solver mode: CPU or GPU 26 | solver_mode: GPU 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/create_cifar10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # This script converts the cifar data into leveldb format. 3 | set -e 4 | 5 | EXAMPLE=examples/cifar10 6 | DATA=data/cifar10 7 | DBTYPE=lmdb 8 | 9 | echo "Creating $DBTYPE..." 10 | 11 | rm -rf $EXAMPLE/cifar10_train_$DBTYPE $EXAMPLE/cifar10_test_$DBTYPE 12 | 13 | ./build/examples/cifar10/convert_cifar_data.bin $DATA $EXAMPLE $DBTYPE 14 | 15 | echo "Computing image mean..." 16 | 17 | ./build/tools/compute_image_mean -backend=$DBTYPE \ 18 | $EXAMPLE/cifar10_train_$DBTYPE $EXAMPLE/mean.binaryproto 19 | 20 | echo "Done." 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/train_full.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | TOOLS=./build/tools 5 | 6 | $TOOLS/caffe train \ 7 | --solver=examples/cifar10/cifar10_full_solver.prototxt $@ 8 | 9 | # reduce learning rate by factor of 10 10 | $TOOLS/caffe train \ 11 | --solver=examples/cifar10/cifar10_full_solver_lr1.prototxt \ 12 | --snapshot=examples/cifar10/cifar10_full_iter_60000.solverstate $@ 13 | 14 | # reduce learning rate by factor of 10 15 | $TOOLS/caffe train \ 16 | --solver=examples/cifar10/cifar10_full_solver_lr2.prototxt \ 17 | --snapshot=examples/cifar10/cifar10_full_iter_65000.solverstate $@ 18 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/train_full_sigmoid.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | TOOLS=./build/tools 5 | 6 | $TOOLS/caffe train \ 7 | --solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt $@ 8 | 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/train_full_sigmoid_bn.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | TOOLS=./build/tools 5 | 6 | $TOOLS/caffe train \ 7 | --solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt $@ 8 | 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/cifar10/train_quick.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | TOOLS=./build/tools 5 | 6 | $TOOLS/caffe train \ 7 | --solver=examples/cifar10/cifar10_quick_solver.prototxt $@ 8 | 9 | # reduce learning rate by factor of 10 after 8 epochs 10 | $TOOLS/caffe train \ 11 | --solver=examples/cifar10/cifar10_quick_solver_lr1.prototxt \ 12 | --snapshot=examples/cifar10/cifar10_quick_iter_4000.solverstate $@ 13 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/finetune_flickr_style/flickr_style.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/examples/finetune_flickr_style/flickr_style.csv.gz -------------------------------------------------------------------------------- /3rdparty/caffe/examples/finetune_flickr_style/style_names.txt: -------------------------------------------------------------------------------- 1 | Detailed 2 | Pastel 3 | Melancholy 4 | Noir 5 | HDR 6 | Vintage 7 | Long Exposure 8 | Horror 9 | Sunny 10 | Bright 11 | Hazy 12 | Bokeh 13 | Serene 14 | Texture 15 | Ethereal 16 | Macro 17 | Depth of Field 18 | Geometric Composition 19 | Minimal 20 | Romantic 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/finetune_pascal_detection/pascal_finetune_solver.prototxt: -------------------------------------------------------------------------------- 1 | net: "examples/finetune_pascal_detection/pascal_finetune_trainval_test.prototxt" 2 | test_iter: 100 3 | test_interval: 1000 4 | base_lr: 0.001 5 | lr_policy: "step" 6 | gamma: 0.1 7 | stepsize: 20000 8 | display: 20 9 | max_iter: 100000 10 | momentum: 0.9 11 | weight_decay: 0.0005 12 | snapshot: 10000 13 | snapshot_prefix: "examples/finetune_pascal_detection/pascal_det_finetune" 14 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/hdf5_classification/nonlinear_auto_test.prototxt: -------------------------------------------------------------------------------- 1 | layer { 2 | name: "data" 3 | type: "HDF5Data" 4 | top: "data" 5 | top: "label" 6 | hdf5_data_param { 7 | source: "examples/hdf5_classification/data/test.txt" 8 | batch_size: 10 9 | } 10 | } 11 | layer { 12 | name: "ip1" 13 | type: "InnerProduct" 14 | bottom: "data" 15 | top: "ip1" 16 | inner_product_param { 17 | num_output: 40 18 | weight_filler { 19 | type: "xavier" 20 | } 21 | } 22 | } 23 | layer { 24 | name: "relu1" 25 | type: "ReLU" 26 | bottom: "ip1" 27 | top: "ip1" 28 | } 29 | layer { 30 | name: "ip2" 31 | type: "InnerProduct" 32 | bottom: "ip1" 33 | top: "ip2" 34 | inner_product_param { 35 | num_output: 2 36 | weight_filler { 37 | type: "xavier" 38 | } 39 | } 40 | } 41 | layer { 42 | name: "accuracy" 43 | type: "Accuracy" 44 | bottom: "ip2" 45 | bottom: "label" 46 | top: "accuracy" 47 | } 48 | layer { 49 | name: "loss" 50 | type: "SoftmaxWithLoss" 51 | bottom: "ip2" 52 | bottom: "label" 53 | top: "loss" 54 | } 55 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/hdf5_classification/nonlinear_auto_train.prototxt: -------------------------------------------------------------------------------- 1 | layer { 2 | name: "data" 3 | type: "HDF5Data" 4 | top: "data" 5 | top: "label" 6 | hdf5_data_param { 7 | source: "examples/hdf5_classification/data/train.txt" 8 | batch_size: 10 9 | } 10 | } 11 | layer { 12 | name: "ip1" 13 | type: "InnerProduct" 14 | bottom: "data" 15 | top: "ip1" 16 | inner_product_param { 17 | num_output: 40 18 | weight_filler { 19 | type: "xavier" 20 | } 21 | } 22 | } 23 | layer { 24 | name: "relu1" 25 | type: "ReLU" 26 | bottom: "ip1" 27 | top: "ip1" 28 | } 29 | layer { 30 | name: "ip2" 31 | type: "InnerProduct" 32 | bottom: "ip1" 33 | top: "ip2" 34 | inner_product_param { 35 | num_output: 2 36 | weight_filler { 37 | type: "xavier" 38 | } 39 | } 40 | } 41 | layer { 42 | name: "accuracy" 43 | type: "Accuracy" 44 | bottom: "ip2" 45 | bottom: "label" 46 | top: "accuracy" 47 | } 48 | layer { 49 | name: "loss" 50 | type: "SoftmaxWithLoss" 51 | bottom: "ip2" 52 | bottom: "label" 53 | top: "loss" 54 | } 55 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/imagenet/make_imagenet_mean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Compute the mean image from the imagenet training lmdb 3 | # N.B. this is available in data/ilsvrc12 4 | 5 | EXAMPLE=examples/imagenet 6 | DATA=data/ilsvrc12 7 | TOOLS=build/tools 8 | 9 | $TOOLS/compute_image_mean $EXAMPLE/ilsvrc12_train_lmdb \ 10 | $DATA/imagenet_mean.binaryproto 11 | 12 | echo "Done." 13 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/imagenet/resume_training.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=models/bvlc_reference_caffenet/solver.prototxt \ 6 | --snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5 \ 7 | $@ 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/imagenet/train_caffenet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=models/bvlc_reference_caffenet/solver.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/images/cat gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/examples/images/cat gray.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/examples/images/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/examples/images/cat.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/examples/images/cat_gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/examples/images/cat_gray.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/examples/images/fish-bike.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/examples/images/fish-bike.jpg -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/create_mnist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # This script converts the mnist data into lmdb/leveldb format, 3 | # depending on the value assigned to $BACKEND. 4 | set -e 5 | 6 | EXAMPLE=examples/mnist 7 | DATA=data/mnist 8 | BUILD=build/examples/mnist 9 | 10 | BACKEND="lmdb" 11 | 12 | echo "Creating ${BACKEND}..." 13 | 14 | rm -rf $EXAMPLE/mnist_train_${BACKEND} 15 | rm -rf $EXAMPLE/mnist_test_${BACKEND} 16 | 17 | $BUILD/convert_mnist_data.bin $DATA/train-images-idx3-ubyte \ 18 | $DATA/train-labels-idx1-ubyte $EXAMPLE/mnist_train_${BACKEND} --backend=${BACKEND} 19 | $BUILD/convert_mnist_data.bin $DATA/t10k-images-idx3-ubyte \ 20 | $DATA/t10k-labels-idx1-ubyte $EXAMPLE/mnist_test_${BACKEND} --backend=${BACKEND} 21 | 22 | echo "Done." 23 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_adadelta_solver.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | net: "examples/mnist/lenet_train_test.prototxt" 3 | # test_iter specifies how many forward passes the test should carry out. 4 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 5 | # covering the full 10,000 testing images. 6 | test_iter: 100 7 | # Carry out testing every 500 training iterations. 8 | test_interval: 500 9 | # The base learning rate, momentum and the weight decay of the network. 10 | base_lr: 1.0 11 | lr_policy: "fixed" 12 | momentum: 0.95 13 | weight_decay: 0.0005 14 | # Display every 100 iterations 15 | display: 100 16 | # The maximum number of iterations 17 | max_iter: 10000 18 | # snapshot intermediate results 19 | snapshot: 5000 20 | snapshot_prefix: "examples/mnist/lenet_adadelta" 21 | # solver mode: CPU or GPU 22 | solver_mode: GPU 23 | type: "AdaDelta" 24 | delta: 1e-6 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_auto_solver.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | train_net: "mnist/lenet_auto_train.prototxt" 3 | test_net: "mnist/lenet_auto_test.prototxt" 4 | # test_iter specifies how many forward passes the test should carry out. 5 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 6 | # covering the full 10,000 testing images. 7 | test_iter: 100 8 | # Carry out testing every 500 training iterations. 9 | test_interval: 500 10 | # The base learning rate, momentum and the weight decay of the network. 11 | base_lr: 0.01 12 | momentum: 0.9 13 | weight_decay: 0.0005 14 | # The learning rate policy 15 | lr_policy: "inv" 16 | gamma: 0.0001 17 | power: 0.75 18 | # Display every 100 iterations 19 | display: 100 20 | # The maximum number of iterations 21 | max_iter: 10000 22 | # snapshot intermediate results 23 | snapshot: 5000 24 | snapshot_prefix: "mnist/lenet" 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_multistep_solver.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | net: "examples/mnist/lenet_train_test.prototxt" 3 | # test_iter specifies how many forward passes the test should carry out. 4 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 5 | # covering the full 10,000 testing images. 6 | test_iter: 100 7 | # Carry out testing every 500 training iterations. 8 | test_interval: 500 9 | # The base learning rate, momentum and the weight decay of the network. 10 | base_lr: 0.01 11 | momentum: 0.9 12 | weight_decay: 0.0005 13 | # The learning rate policy 14 | lr_policy: "multistep" 15 | gamma: 0.9 16 | stepvalue: 5000 17 | stepvalue: 7000 18 | stepvalue: 8000 19 | stepvalue: 9000 20 | stepvalue: 9500 21 | # Display every 100 iterations 22 | display: 100 23 | # The maximum number of iterations 24 | max_iter: 10000 25 | # snapshot intermediate results 26 | snapshot: 5000 27 | snapshot_prefix: "examples/mnist/lenet_multistep" 28 | # solver mode: CPU or GPU 29 | solver_mode: GPU 30 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_solver.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | net: "examples/mnist/lenet_train_test.prototxt" 3 | # test_iter specifies how many forward passes the test should carry out. 4 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 5 | # covering the full 10,000 testing images. 6 | test_iter: 100 7 | # Carry out testing every 500 training iterations. 8 | test_interval: 500 9 | # The base learning rate, momentum and the weight decay of the network. 10 | base_lr: 0.01 11 | momentum: 0.9 12 | weight_decay: 0.0005 13 | # The learning rate policy 14 | lr_policy: "inv" 15 | gamma: 0.0001 16 | power: 0.75 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 10000 21 | # snapshot intermediate results 22 | snapshot: 5000 23 | snapshot_prefix: "examples/mnist/lenet" 24 | # solver mode: CPU or GPU 25 | solver_mode: GPU 26 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_solver_adam.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | # this follows "ADAM: A METHOD FOR STOCHASTIC OPTIMIZATION" 3 | net: "examples/mnist/lenet_train_test.prototxt" 4 | # test_iter specifies how many forward passes the test should carry out. 5 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 6 | # covering the full 10,000 testing images. 7 | test_iter: 100 8 | # Carry out testing every 500 training iterations. 9 | test_interval: 500 10 | # All parameters are from the cited paper above 11 | base_lr: 0.001 12 | momentum: 0.9 13 | momentum2: 0.999 14 | # since Adam dynamically changes the learning rate, we set the base learning 15 | # rate to a fixed value 16 | lr_policy: "fixed" 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 10000 21 | # snapshot intermediate results 22 | snapshot: 5000 23 | snapshot_prefix: "examples/mnist/lenet" 24 | # solver mode: CPU or GPU 25 | type: "Adam" 26 | solver_mode: GPU 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/lenet_solver_rmsprop.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | net: "examples/mnist/lenet_train_test.prototxt" 3 | # test_iter specifies how many forward passes the test should carry out. 4 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 5 | # covering the full 10,000 testing images. 6 | test_iter: 100 7 | # Carry out testing every 500 training iterations. 8 | test_interval: 500 9 | # The base learning rate, momentum and the weight decay of the network. 10 | base_lr: 0.01 11 | momentum: 0.0 12 | weight_decay: 0.0005 13 | # The learning rate policy 14 | lr_policy: "inv" 15 | gamma: 0.0001 16 | power: 0.75 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 10000 21 | # snapshot intermediate results 22 | snapshot: 5000 23 | snapshot_prefix: "examples/mnist/lenet_rmsprop" 24 | # solver mode: CPU or GPU 25 | solver_mode: GPU 26 | type: "RMSProp" 27 | rms_decay: 0.98 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/mnist_autoencoder_solver.prototxt: -------------------------------------------------------------------------------- 1 | net: "examples/mnist/mnist_autoencoder.prototxt" 2 | test_state: { stage: 'test-on-train' } 3 | test_iter: 500 4 | test_state: { stage: 'test-on-test' } 5 | test_iter: 100 6 | test_interval: 500 7 | test_compute_loss: true 8 | base_lr: 0.01 9 | lr_policy: "step" 10 | gamma: 0.1 11 | stepsize: 10000 12 | display: 100 13 | max_iter: 65000 14 | weight_decay: 0.0005 15 | snapshot: 10000 16 | snapshot_prefix: "examples/mnist/mnist_autoencoder" 17 | momentum: 0.9 18 | # solver mode: CPU or GPU 19 | solver_mode: GPU 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/mnist_autoencoder_solver_adadelta.prototxt: -------------------------------------------------------------------------------- 1 | net: "examples/mnist/mnist_autoencoder.prototxt" 2 | test_state: { stage: 'test-on-train' } 3 | test_iter: 500 4 | test_state: { stage: 'test-on-test' } 5 | test_iter: 100 6 | test_interval: 500 7 | test_compute_loss: true 8 | base_lr: 1.0 9 | lr_policy: "fixed" 10 | momentum: 0.95 11 | delta: 1e-8 12 | display: 100 13 | max_iter: 65000 14 | weight_decay: 0.0005 15 | snapshot: 10000 16 | snapshot_prefix: "examples/mnist/mnist_autoencoder_adadelta_train" 17 | # solver mode: CPU or GPU 18 | solver_mode: GPU 19 | type: "AdaDelta" 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/mnist_autoencoder_solver_adagrad.prototxt: -------------------------------------------------------------------------------- 1 | net: "examples/mnist/mnist_autoencoder.prototxt" 2 | test_state: { stage: 'test-on-train' } 3 | test_iter: 500 4 | test_state: { stage: 'test-on-test' } 5 | test_iter: 100 6 | test_interval: 500 7 | test_compute_loss: true 8 | base_lr: 0.01 9 | lr_policy: "fixed" 10 | display: 100 11 | max_iter: 65000 12 | weight_decay: 0.0005 13 | snapshot: 10000 14 | snapshot_prefix: "examples/mnist/mnist_autoencoder_adagrad_train" 15 | # solver mode: CPU or GPU 16 | solver_mode: GPU 17 | type: "AdaGrad" 18 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/mnist_autoencoder_solver_nesterov.prototxt: -------------------------------------------------------------------------------- 1 | net: "examples/mnist/mnist_autoencoder.prototxt" 2 | test_state: { stage: 'test-on-train' } 3 | test_iter: 500 4 | test_state: { stage: 'test-on-test' } 5 | test_iter: 100 6 | test_interval: 500 7 | test_compute_loss: true 8 | base_lr: 0.01 9 | lr_policy: "step" 10 | gamma: 0.1 11 | stepsize: 10000 12 | display: 100 13 | max_iter: 65000 14 | weight_decay: 0.0005 15 | snapshot: 10000 16 | snapshot_prefix: "examples/mnist/mnist_autoencoder_nesterov_train" 17 | momentum: 0.95 18 | # solver mode: CPU or GPU 19 | solver_mode: GPU 20 | type: "Nesterov" 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_lenet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt $@ 5 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_lenet_adam.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt $@ 5 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_lenet_consolidated.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/lenet_consolidated_solver.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_lenet_rmsprop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/lenet_solver_rmsprop.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_mnist_autoencoder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/mnist_autoencoder_solver.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_mnist_autoencoder_adadelta.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_mnist_autoencoder_adagrad.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/mnist/train_mnist_autoencoder_nesterov.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ./build/tools/caffe train \ 5 | --solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt $@ 6 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/net_surgery/conv.prototxt: -------------------------------------------------------------------------------- 1 | # Simple single-layer network to showcase editing model parameters. 2 | name: "convolution" 3 | layer { 4 | name: "data" 5 | type: "Input" 6 | top: "data" 7 | input_param { shape: { dim: 1 dim: 1 dim: 100 dim: 100 } } 8 | } 9 | layer { 10 | name: "conv" 11 | type: "Convolution" 12 | bottom: "data" 13 | top: "conv" 14 | convolution_param { 15 | num_output: 3 16 | kernel_size: 5 17 | stride: 1 18 | weight_filler { 19 | type: "gaussian" 20 | std: 0.01 21 | } 22 | bias_filler { 23 | type: "constant" 24 | value: 0 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/siamese/create_mnist_siamese.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # This script converts the mnist data into leveldb format. 3 | set -e 4 | 5 | EXAMPLES=./build/examples/siamese 6 | DATA=./data/mnist 7 | 8 | echo "Creating leveldb..." 9 | 10 | rm -rf ./examples/siamese/mnist_siamese_train_leveldb 11 | rm -rf ./examples/siamese/mnist_siamese_test_leveldb 12 | 13 | $EXAMPLES/convert_mnist_siamese_data.bin \ 14 | $DATA/train-images-idx3-ubyte \ 15 | $DATA/train-labels-idx1-ubyte \ 16 | ./examples/siamese/mnist_siamese_train_leveldb 17 | $EXAMPLES/convert_mnist_siamese_data.bin \ 18 | $DATA/t10k-images-idx3-ubyte \ 19 | $DATA/t10k-labels-idx1-ubyte \ 20 | ./examples/siamese/mnist_siamese_test_leveldb 21 | 22 | echo "Done." 23 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/siamese/mnist_siamese_solver.prototxt: -------------------------------------------------------------------------------- 1 | # The train/test net protocol buffer definition 2 | net: "examples/siamese/mnist_siamese_train_test.prototxt" 3 | # test_iter specifies how many forward passes the test should carry out. 4 | # In the case of MNIST, we have test batch size 100 and 100 test iterations, 5 | # covering the full 10,000 testing images. 6 | test_iter: 100 7 | # Carry out testing every 500 training iterations. 8 | test_interval: 500 9 | # The base learning rate, momentum and the weight decay of the network. 10 | base_lr: 0.01 11 | momentum: 0.9 12 | weight_decay: 0.0000 13 | # The learning rate policy 14 | lr_policy: "inv" 15 | gamma: 0.0001 16 | power: 0.75 17 | # Display every 100 iterations 18 | display: 100 19 | # The maximum number of iterations 20 | max_iter: 50000 21 | # snapshot intermediate results 22 | snapshot: 5000 23 | snapshot_prefix: "examples/siamese/mnist_siamese" 24 | # solver mode: CPU or GPU 25 | solver_mode: GPU 26 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/siamese/train_mnist_siamese.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | TOOLS=./build/tools 5 | 6 | $TOOLS/caffe train --solver=examples/siamese/mnist_siamese_solver.prototxt $@ 7 | -------------------------------------------------------------------------------- /3rdparty/caffe/examples/web_demo/requirements.txt: -------------------------------------------------------------------------------- 1 | werkzeug 2 | flask 3 | tornado 4 | numpy 5 | pandas 6 | pillow 7 | pyyaml 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/caffe.hpp: -------------------------------------------------------------------------------- 1 | // caffe.hpp is the header file that you need to include in your code. It wraps 2 | // all the internal caffe header files into one for simpler inclusion. 3 | 4 | #ifndef CAFFE_CAFFE_HPP_ 5 | #define CAFFE_CAFFE_HPP_ 6 | 7 | #include "caffe/blob.hpp" 8 | #include "caffe/common.hpp" 9 | #include "caffe/filler.hpp" 10 | #include "caffe/layer.hpp" 11 | #include "caffe/layer_factory.hpp" 12 | #include "caffe/net.hpp" 13 | #include "caffe/parallel.hpp" 14 | #include "caffe/proto/caffe.pb.h" 15 | #include "caffe/solver.hpp" 16 | #include "caffe/solver_factory.hpp" 17 | #include "caffe/util/benchmark.hpp" 18 | #include "caffe/util/io.hpp" 19 | #include "caffe/util/upgrade_proto.hpp" 20 | 21 | #endif // CAFFE_CAFFE_HPP_ 22 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/layers/neuron_layer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE_NEURON_LAYER_HPP_ 2 | #define CAFFE_NEURON_LAYER_HPP_ 3 | 4 | #include 5 | 6 | #include "caffe/blob.hpp" 7 | #include "caffe/layer.hpp" 8 | #include "caffe/proto/caffe.pb.h" 9 | 10 | namespace caffe { 11 | 12 | /** 13 | * @brief An interface for layers that take one blob as input (@f$ x @f$) 14 | * and produce one equally-sized blob as output (@f$ y @f$), where 15 | * each element of the output depends only on the corresponding input 16 | * element. 17 | */ 18 | template 19 | class NeuronLayer : public Layer { 20 | public: 21 | explicit NeuronLayer(const LayerParameter& param) 22 | : Layer(param) {} 23 | virtual void Reshape(const vector*>& bottom, 24 | const vector*>& top); 25 | 26 | virtual inline int ExactNumBottomBlobs() const { return 1; } 27 | virtual inline int ExactNumTopBlobs() const { return 1; } 28 | }; 29 | 30 | } // namespace caffe 31 | 32 | #endif // CAFFE_NEURON_LAYER_HPP_ 33 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/util/blocking_queue.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE_UTIL_BLOCKING_QUEUE_HPP_ 2 | #define CAFFE_UTIL_BLOCKING_QUEUE_HPP_ 3 | 4 | #include 5 | #include 6 | 7 | namespace caffe { 8 | 9 | template 10 | class BlockingQueue { 11 | public: 12 | explicit BlockingQueue(); 13 | 14 | void push(const T& t); 15 | 16 | bool try_pop(T* t); 17 | 18 | // This logs a message if the threads needs to be blocked 19 | // useful for detecting e.g. when data feeding is too slow 20 | T pop(const string& log_on_wait = ""); 21 | 22 | bool try_peek(T* t); 23 | 24 | // Return element without removing it 25 | T peek(); 26 | 27 | size_t size() const; 28 | 29 | protected: 30 | /** 31 | Move synchronization fields out instead of including boost/thread.hpp 32 | to avoid a boost/NVCC issues (#1009, #1010) on OSX. Also fails on 33 | Linux CUDA 7.0.18. 34 | */ 35 | class sync; 36 | 37 | std::queue queue_; 38 | shared_ptr sync_; 39 | 40 | DISABLE_COPY_AND_ASSIGN(BlockingQueue); 41 | }; 42 | 43 | } // namespace caffe 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/util/format.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE_UTIL_FORMAT_H_ 2 | #define CAFFE_UTIL_FORMAT_H_ 3 | 4 | #include // NOLINT(readability/streams) 5 | #include // NOLINT(readability/streams) 6 | #include 7 | 8 | namespace caffe { 9 | 10 | inline std::string format_int(int n, int numberOfLeadingZeros = 0 ) { 11 | std::ostringstream s; 12 | s << std::setw(numberOfLeadingZeros) << std::setfill('0') << n; 13 | return s.str(); 14 | } 15 | 16 | } 17 | 18 | #endif // CAFFE_UTIL_FORMAT_H_ 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/util/insert_splits.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _CAFFE_UTIL_INSERT_SPLITS_HPP_ 2 | #define _CAFFE_UTIL_INSERT_SPLITS_HPP_ 3 | 4 | #include 5 | 6 | #include "caffe/proto/caffe.pb.h" 7 | 8 | namespace caffe { 9 | 10 | // Copy NetParameters with SplitLayers added to replace any shared bottom 11 | // blobs with unique bottom blobs provided by the SplitLayer. 12 | void InsertSplits(const NetParameter& param, NetParameter* param_split); 13 | 14 | void ConfigureSplitLayer(const string& layer_name, const string& blob_name, 15 | const int blob_idx, const int split_count, const float loss_weight, 16 | LayerParameter* split_layer_param); 17 | 18 | string SplitLayerName(const string& layer_name, const string& blob_name, 19 | const int blob_idx); 20 | 21 | string SplitBlobName(const string& layer_name, const string& blob_name, 22 | const int blob_idx, const int split_idx); 23 | 24 | } // namespace caffe 25 | 26 | #endif // CAFFE_UTIL_INSERT_SPLITS_HPP_ 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/util/nccl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE_UTIL_NCCL_H_ 2 | #define CAFFE_UTIL_NCCL_H_ 3 | #ifdef USE_NCCL 4 | 5 | #include 6 | 7 | #include "caffe/common.hpp" 8 | 9 | #define NCCL_CHECK(condition) \ 10 | { \ 11 | ncclResult_t result = condition; \ 12 | CHECK_EQ(result, ncclSuccess) << " " \ 13 | << ncclGetErrorString(result); \ 14 | } 15 | 16 | namespace caffe { 17 | 18 | namespace nccl { 19 | 20 | template class dataType; 21 | 22 | template<> class dataType { 23 | public: 24 | static const ncclDataType_t type = ncclFloat; 25 | }; 26 | template<> class dataType { 27 | public: 28 | static const ncclDataType_t type = ncclDouble; 29 | }; 30 | 31 | } // namespace nccl 32 | 33 | } // namespace caffe 34 | 35 | #endif // end USE_NCCL 36 | 37 | #endif // CAFFE_UTIL_NCCL_H_ 38 | -------------------------------------------------------------------------------- /3rdparty/caffe/include/caffe/util/signal_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_CAFFE_UTIL_SIGNAL_HANDLER_H_ 2 | #define INCLUDE_CAFFE_UTIL_SIGNAL_HANDLER_H_ 3 | 4 | #include "caffe/proto/caffe.pb.h" 5 | #include "caffe/solver.hpp" 6 | 7 | namespace caffe { 8 | 9 | class SignalHandler { 10 | public: 11 | // Contructor. Specify what action to take when a signal is received. 12 | SignalHandler(SolverAction::Enum SIGINT_action, 13 | SolverAction::Enum SIGHUP_action); 14 | ~SignalHandler(); 15 | ActionCallback GetActionFunction(); 16 | private: 17 | SolverAction::Enum CheckForSignals() const; 18 | SolverAction::Enum SIGINT_action_; 19 | SolverAction::Enum SIGHUP_action_; 20 | }; 21 | 22 | } // namespace caffe 23 | 24 | #endif // INCLUDE_CAFFE_UTIL_SIGNAL_HANDLER_H_ 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/+test/test_io.m: -------------------------------------------------------------------------------- 1 | classdef test_io < matlab.unittest.TestCase 2 | methods (Test) 3 | function test_read_write_mean(self) 4 | % randomly generate mean data 5 | width = 200; 6 | height = 300; 7 | channels = 3; 8 | mean_data_write = 255 * rand(width, height, channels, 'single'); 9 | % write mean data to binary proto 10 | mean_proto_file = tempname(); 11 | caffe.io.write_mean(mean_data_write, mean_proto_file); 12 | % read mean data from saved binary proto and test whether they are equal 13 | mean_data_read = caffe.io.read_mean(mean_proto_file); 14 | self.verifyEqual(mean_data_write, mean_data_read) 15 | delete(mean_proto_file); 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/Layer.m: -------------------------------------------------------------------------------- 1 | classdef Layer < handle 2 | % Wrapper class of caffe::Layer in matlab 3 | 4 | properties (Access = private) 5 | hLayer_self 6 | attributes 7 | % attributes fields: 8 | % hBlob_blobs 9 | end 10 | properties (SetAccess = private) 11 | params 12 | end 13 | 14 | methods 15 | function self = Layer(hLayer_layer) 16 | CHECK(is_valid_handle(hLayer_layer), 'invalid Layer handle'); 17 | 18 | % setup self handle and attributes 19 | self.hLayer_self = hLayer_layer; 20 | self.attributes = caffe_('layer_get_attr', self.hLayer_self); 21 | 22 | % setup weights 23 | self.params = caffe.Blob.empty(); 24 | for n = 1:length(self.attributes.hBlob_blobs) 25 | self.params(n) = caffe.Blob(self.attributes.hBlob_blobs(n)); 26 | end 27 | end 28 | function layer_type = type(self) 29 | layer_type = caffe_('layer_get_type', self.hLayer_self); 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/get_solver.m: -------------------------------------------------------------------------------- 1 | function solver = get_solver(solver_file) 2 | % solver = get_solver(solver_file) 3 | % Construct a Solver object from solver_file 4 | 5 | CHECK(ischar(solver_file), 'solver_file must be a string'); 6 | CHECK_FILE_EXIST(solver_file); 7 | pSolver = caffe_('get_solver', solver_file); 8 | solver = caffe.Solver(pSolver); 9 | 10 | end 11 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/private/CHECK.m: -------------------------------------------------------------------------------- 1 | function CHECK(expr, error_msg) 2 | 3 | if ~expr 4 | error(error_msg); 5 | end 6 | 7 | end 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/private/CHECK_FILE_EXIST.m: -------------------------------------------------------------------------------- 1 | function CHECK_FILE_EXIST(filename) 2 | 3 | if exist(filename, 'file') == 0 4 | error('%s does not exist', filename); 5 | end 6 | 7 | end 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/private/is_valid_handle.m: -------------------------------------------------------------------------------- 1 | function valid = is_valid_handle(hObj) 2 | % valid = is_valid_handle(hObj) or is_valid_handle('get_new_init_key') 3 | % Check if a handle is valid (has the right data type and init_key matches) 4 | % Use is_valid_handle('get_new_init_key') to get new init_key from C++; 5 | 6 | % a handle is a struct array with the following fields 7 | % (uint64) ptr : the pointer to the C++ object 8 | % (double) init_key : caffe initialization key 9 | 10 | persistent init_key; 11 | if isempty(init_key) 12 | init_key = caffe_('get_init_key'); 13 | end 14 | 15 | % is_valid_handle('get_new_init_key') to get new init_key from C++; 16 | if ischar(hObj) && strcmp(hObj, 'get_new_init_key') 17 | init_key = caffe_('get_init_key'); 18 | return 19 | else 20 | % check whether data types are correct and init_key matches 21 | valid = isstruct(hObj) ... 22 | && isscalar(hObj.ptr) && isa(hObj.ptr, 'uint64') ... 23 | && isscalar(hObj.init_key) && isa(hObj.init_key, 'double') ... 24 | && hObj.init_key == init_key; 25 | end 26 | 27 | end 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/reset_all.m: -------------------------------------------------------------------------------- 1 | function reset_all() 2 | % reset_all() 3 | % clear all solvers and stand-alone nets and reset Caffe to initial status 4 | 5 | caffe_('reset'); 6 | is_valid_handle('get_new_init_key'); 7 | 8 | end 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/run_tests.m: -------------------------------------------------------------------------------- 1 | function results = run_tests() 2 | % results = run_tests() 3 | % run all tests in this caffe matlab wrapper package 4 | 5 | % use CPU for testing 6 | caffe.set_mode_cpu(); 7 | 8 | % reset caffe before testing 9 | caffe.reset_all(); 10 | 11 | % put all test cases here 12 | results = [... 13 | run(caffe.test.test_net) ... 14 | run(caffe.test.test_solver) ... 15 | run(caffe.test.test_io) ]; 16 | 17 | % reset caffe after testing 18 | caffe.reset_all(); 19 | 20 | end 21 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/set_device.m: -------------------------------------------------------------------------------- 1 | function set_device(device_id) 2 | % set_device(device_id) 3 | % set Caffe's GPU device ID 4 | 5 | CHECK(isscalar(device_id) && device_id >= 0, ... 6 | 'device_id must be non-negative integer'); 7 | device_id = double(device_id); 8 | 9 | caffe_('set_device', device_id); 10 | 11 | end 12 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/set_mode_cpu.m: -------------------------------------------------------------------------------- 1 | function set_mode_cpu() 2 | % set_mode_cpu() 3 | % set Caffe to CPU mode 4 | 5 | caffe_('set_mode_cpu'); 6 | 7 | end 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/set_mode_gpu.m: -------------------------------------------------------------------------------- 1 | function set_mode_gpu() 2 | % set_mode_gpu() 3 | % set Caffe to GPU mode 4 | 5 | caffe_('set_mode_gpu'); 6 | 7 | end 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/+caffe/version.m: -------------------------------------------------------------------------------- 1 | function version_str = version() 2 | % version() 3 | % show Caffe's version. 4 | 5 | version_str = caffe_('version'); 6 | 7 | end 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/matlab/hdf5creation/.gitignore: -------------------------------------------------------------------------------- 1 | *.h5 2 | list.txt 3 | -------------------------------------------------------------------------------- /3rdparty/caffe/python/caffe/__init__.py: -------------------------------------------------------------------------------- 1 | from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer 2 | from ._caffe import init_log, log, set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list, set_random_seed, solver_count, set_solver_count, solver_rank, set_solver_rank, set_multiprocess, has_nccl 3 | from ._caffe import __version__ 4 | from .proto.caffe_pb2 import TRAIN, TEST 5 | from .classifier import Classifier 6 | from .detector import Detector 7 | from . import io 8 | from .net_spec import layers, params, NetSpec, to_proto 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/python/caffe/imagenet/ilsvrc_2012_mean.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/python/caffe/imagenet/ilsvrc_2012_mean.npy -------------------------------------------------------------------------------- /3rdparty/caffe/python/caffe/proto/__init__.py: -------------------------------------------------------------------------------- 1 | from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer 2 | from ._caffe import init_log, log, set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list, set_random_seed, solver_count, set_solver_count, solver_rank, set_solver_rank, set_multiprocess, has_nccl 3 | from ._caffe import __version__ 4 | from .proto.caffe_pb2 import TRAIN, TEST 5 | from .classifier import Classifier 6 | from .detector import Detector 7 | from . import io 8 | from .net_spec import layers, params, NetSpec, to_proto 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/python/caffe/test/test_layer_type_list.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import caffe 4 | 5 | class TestLayerTypeList(unittest.TestCase): 6 | 7 | def test_standard_types(self): 8 | #removing 'Data' from list 9 | for type_name in ['Data', 'Convolution', 'InnerProduct']: 10 | self.assertIn(type_name, caffe.layer_type_list(), 11 | '%s not in layer_type_list()' % type_name) 12 | -------------------------------------------------------------------------------- /3rdparty/caffe/python/caffe/test/test_nccl.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import unittest 3 | 4 | import caffe 5 | 6 | 7 | class TestNCCL(unittest.TestCase): 8 | 9 | def test_newuid(self): 10 | """ 11 | Test that NCCL uids are of the proper type 12 | according to python version 13 | """ 14 | if caffe.has_nccl(): 15 | uid = caffe.NCCL.new_uid() 16 | if sys.version_info.major >= 3: 17 | self.assertTrue(isinstance(uid, bytes)) 18 | else: 19 | self.assertTrue(isinstance(uid, str)) 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/python/requirements.txt: -------------------------------------------------------------------------------- 1 | Cython>=0.19.2 2 | numpy>=1.7.1 3 | scipy>=0.13.2 4 | scikit-image>=0.9.3 5 | matplotlib>=1.3.1 6 | ipython>=3.0.0 7 | h5py>=2.2.0 8 | leveldb>=0.191 9 | networkx>=1.8.1 10 | nose>=1.3.0 11 | pandas>=0.12.0 12 | python-dateutil>=1.4,<2 13 | protobuf>=2.5.0 14 | python-gflags>=2.0 15 | pyyaml>=3.10 16 | Pillow>=2.3.0 17 | six>=1.1.0 -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/build_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Build documentation for display in web browser. 3 | 4 | PORT=${1:-4000} 5 | 6 | echo "usage: build_docs.sh [port]" 7 | 8 | # Find the docs dir, no matter where the script is called 9 | ROOT_DIR="$( cd "$(dirname "$0")"/.. ; pwd -P )" 10 | cd $ROOT_DIR 11 | 12 | # Gather docs. 13 | scripts/gather_examples.sh 14 | 15 | # Split caffe.proto for inclusion by layer catalogue. 16 | scripts/split_caffe_proto.py 17 | 18 | # Generate developer docs. 19 | make docs 20 | 21 | # Display docs using web server. 22 | cd docs 23 | jekyll serve -w -s . -d _site --port=$PORT 24 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/download_model_from_gist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | GIST=$1 4 | DIRNAME=${2:-./models} 5 | 6 | if [ -z $GIST ]; then 7 | echo "usage: download_model_from_gist.sh " 8 | exit 9 | fi 10 | 11 | GIST_DIR=$(echo $GIST | tr '/' '-') 12 | MODEL_DIR="$DIRNAME/$GIST_DIR" 13 | 14 | if [ -d $MODEL_DIR ]; then 15 | echo "$MODEL_DIR already exists! Please make sure you're not overwriting anything important!" 16 | exit 17 | fi 18 | 19 | echo "Downloading Caffe model info to $MODEL_DIR ..." 20 | mkdir -p $MODEL_DIR 21 | wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.zip 22 | unzip -j $MODEL_DIR/gist.zip -d $MODEL_DIR 23 | rm $MODEL_DIR/gist.zip 24 | echo "Done" 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/split_caffe_proto.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import mmap 3 | import re 4 | import os 5 | import errno 6 | 7 | script_path = os.path.dirname(os.path.realpath(__file__)) 8 | 9 | # a regex to match the parameter definitions in caffe.proto 10 | r = re.compile(r'(?://.*\n)*message ([^ ]*) \{\n(?: .*\n|\n)*\}') 11 | 12 | # create directory to put caffe.proto fragments 13 | try: 14 | os.mkdir( 15 | os.path.join(script_path, 16 | '../docs/_includes/')) 17 | os.mkdir( 18 | os.path.join(script_path, 19 | '../docs/_includes/proto/')) 20 | except OSError as exception: 21 | if exception.errno != errno.EEXIST: 22 | raise 23 | 24 | caffe_proto_fn = os.path.join( 25 | script_path, 26 | '../src/caffe/proto/caffe.proto') 27 | 28 | with open(caffe_proto_fn, 'r') as fin: 29 | 30 | for m in r.finditer(fin.read(), re.MULTILINE): 31 | fn = os.path.join( 32 | script_path, 33 | '../docs/_includes/proto/%s.txt' % m.group(1)) 34 | with open(fn, 'w') as fout: 35 | fout.write(m.group(0)) 36 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # build the project 3 | 4 | BASEDIR=$(dirname $0) 5 | source $BASEDIR/defaults.sh 6 | 7 | if ! $WITH_CMAKE ; then 8 | make --jobs $NUM_THREADS all test pycaffe warn 9 | else 10 | cd build 11 | make --jobs $NUM_THREADS all test.testbin 12 | fi 13 | make lint 14 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/configure-cmake.sh: -------------------------------------------------------------------------------- 1 | # CMake configuration 2 | 3 | mkdir -p build 4 | cd build 5 | 6 | ARGS="-DCMAKE_BUILD_TYPE=Release -DBLAS=Open" 7 | 8 | if $WITH_PYTHON3 ; then 9 | ARGS="$ARGS -Dpython_version=3" 10 | fi 11 | 12 | if $WITH_IO ; then 13 | ARGS="$ARGS -DUSE_OPENCV=On -DUSE_LMDB=On -DUSE_LEVELDB=On" 14 | else 15 | ARGS="$ARGS -DUSE_OPENCV=Off -DUSE_LMDB=Off -DUSE_LEVELDB=Off" 16 | fi 17 | 18 | if $WITH_CUDA ; then 19 | # Only build SM50 20 | ARGS="$ARGS -DCPU_ONLY=Off -DCUDA_ARCH_NAME=Manual -DCUDA_ARCH_BIN=\"50\" -DCUDA_ARCH_PTX=\"\"" 21 | else 22 | ARGS="$ARGS -DCPU_ONLY=On" 23 | fi 24 | 25 | if $WITH_CUDNN ; then 26 | ARGS="$ARGS -DUSE_CUDNN=On" 27 | else 28 | ARGS="$ARGS -DUSE_CUDNN=Off" 29 | fi 30 | 31 | cmake .. $ARGS 32 | 33 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/configure-make.sh: -------------------------------------------------------------------------------- 1 | # raw Makefile configuration 2 | 3 | LINE () { 4 | echo "$@" >> Makefile.config 5 | } 6 | 7 | cp Makefile.config.example Makefile.config 8 | 9 | LINE "BLAS := open" 10 | LINE "WITH_PYTHON_LAYER := 1" 11 | 12 | if $WITH_PYTHON3 ; then 13 | # TODO(lukeyeager) this path is currently disabled because of test errors like: 14 | # ImportError: dynamic module does not define init function (PyInit__caffe) 15 | LINE "PYTHON_LIBRARIES := python3.4m boost_python-py34" 16 | LINE "PYTHON_INCLUDE := /usr/include/python3.4 /usr/lib/python3/dist-packages/numpy/core/include" 17 | LINE "INCLUDE_DIRS := \$(INCLUDE_DIRS) \$(PYTHON_INCLUDE)" 18 | fi 19 | 20 | if ! $WITH_IO ; then 21 | LINE "USE_OPENCV := 0" 22 | LINE "USE_LEVELDB := 0" 23 | LINE "USE_LMDB := 0" 24 | fi 25 | 26 | if $WITH_CUDA ; then 27 | # Only build SM50 28 | LINE "CUDA_ARCH := -gencode arch=compute_50,code=sm_50" 29 | else 30 | LINE "CPU_ONLY := 1" 31 | fi 32 | 33 | if $WITH_CUDNN ; then 34 | LINE "USE_CUDNN := 1" 35 | fi 36 | 37 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # configure the project 3 | 4 | BASEDIR=$(dirname $0) 5 | source $BASEDIR/defaults.sh 6 | 7 | if ! $WITH_CMAKE ; then 8 | source $BASEDIR/configure-make.sh 9 | else 10 | source $BASEDIR/configure-cmake.sh 11 | fi 12 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/defaults.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # set default environment variables 3 | 4 | set -e 5 | 6 | WITH_CMAKE=${WITH_CMAKE:-false} 7 | WITH_PYTHON3=${WITH_PYTHON3:-false} 8 | WITH_IO=${WITH_IO:-true} 9 | WITH_CUDA=${WITH_CUDA:-false} 10 | WITH_CUDNN=${WITH_CUDNN:-false} 11 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/install-python-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # install extra Python dependencies 3 | # (must come after setup-venv) 4 | 5 | BASEDIR=$(dirname $0) 6 | source $BASEDIR/defaults.sh 7 | 8 | if ! $WITH_PYTHON3 ; then 9 | # Python2 10 | : 11 | else 12 | # Python3 13 | pip install --pre protobuf==3.0.0b3 14 | pip install pydot 15 | fi 16 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/setup-venv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # setup a Python virtualenv 3 | # (must come after install-deps) 4 | 5 | BASEDIR=$(dirname $0) 6 | source $BASEDIR/defaults.sh 7 | 8 | VENV_DIR=${1:-~/venv} 9 | 10 | # setup our own virtualenv 11 | if $WITH_PYTHON3; then 12 | PYTHON_EXE='/usr/bin/python3' 13 | else 14 | PYTHON_EXE='/usr/bin/python2' 15 | fi 16 | 17 | # use --system-site-packages so that Python will use deb packages 18 | virtualenv $VENV_DIR -p $PYTHON_EXE --system-site-packages 19 | -------------------------------------------------------------------------------- /3rdparty/caffe/scripts/travis/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # test the project 3 | 4 | BASEDIR=$(dirname $0) 5 | source $BASEDIR/defaults.sh 6 | 7 | if $WITH_CUDA ; then 8 | echo "Skipping tests for CUDA build" 9 | exit 0 10 | fi 11 | 12 | if ! $WITH_CMAKE ; then 13 | make runtest 14 | make pytest 15 | else 16 | cd build 17 | make runtest 18 | make pytest 19 | fi 20 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layer.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/layer.hpp" 2 | 3 | namespace caffe { 4 | 5 | INSTANTIATE_CLASS(Layer); 6 | 7 | } // namespace caffe 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/absval_layer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/absval_layer.hpp" 4 | #include "caffe/util/math_functions.hpp" 5 | 6 | namespace caffe { 7 | 8 | template 9 | void AbsValLayer::Forward_gpu( 10 | const vector*>& bottom, const vector*>& top) { 11 | const int count = top[0]->count(); 12 | Dtype* top_data = top[0]->mutable_gpu_data(); 13 | caffe_gpu_abs(count, bottom[0]->gpu_data(), top_data); 14 | } 15 | 16 | template 17 | void AbsValLayer::Backward_gpu(const vector*>& top, 18 | const vector& propagate_down, const vector*>& bottom) { 19 | const int count = top[0]->count(); 20 | const Dtype* top_diff = top[0]->gpu_diff(); 21 | if (propagate_down[0]) { 22 | const Dtype* bottom_data = bottom[0]->gpu_data(); 23 | Dtype* bottom_diff = bottom[0]->mutable_gpu_diff(); 24 | caffe_gpu_sign(count, bottom_data, bottom_diff); 25 | caffe_gpu_mul(count, bottom_diff, top_diff, bottom_diff); 26 | } 27 | } 28 | 29 | INSTANTIATE_LAYER_GPU_FUNCS(AbsValLayer); 30 | 31 | 32 | } // namespace caffe 33 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/base_data_layer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/base_data_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | void BasePrefetchingDataLayer::Forward_gpu( 9 | const vector*>& bottom, const vector*>& top) { 10 | if (prefetch_current_) { 11 | prefetch_free_.push(prefetch_current_); 12 | } 13 | prefetch_current_ = prefetch_full_.pop("Waiting for data"); 14 | // Reshape to loaded data. 15 | top[0]->ReshapeLike(prefetch_current_->data_); 16 | top[0]->set_gpu_data(prefetch_current_->data_.mutable_gpu_data()); 17 | if (this->output_labels_) { 18 | // Reshape to loaded labels. 19 | top[1]->ReshapeLike(prefetch_current_->label_); 20 | top[1]->set_gpu_data(prefetch_current_->label_.mutable_gpu_data()); 21 | } 22 | } 23 | 24 | INSTANTIATE_LAYER_GPU_FORWARD(BasePrefetchingDataLayer); 25 | 26 | } // namespace caffe 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/hdf5_data_layer.cu: -------------------------------------------------------------------------------- 1 | /* 2 | TODO: 3 | - only load parts of the file, in accordance with a prototxt param "max_mem" 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "hdf5.h" 10 | #include "hdf5_hl.h" 11 | 12 | #include "caffe/layers/hdf5_data_layer.hpp" 13 | 14 | namespace caffe { 15 | 16 | template 17 | void HDF5DataLayer::Forward_gpu(const vector*>& bottom, 18 | const vector*>& top) { 19 | const int batch_size = this->layer_param_.hdf5_data_param().batch_size(); 20 | for (int i = 0; i < batch_size; ++i) { 21 | while (Skip()) { 22 | Next(); 23 | } 24 | for (int j = 0; j < this->layer_param_.top_size(); ++j) { 25 | int data_dim = top[j]->count() / top[j]->shape(0); 26 | caffe_copy(data_dim, 27 | &hdf_blobs_[j]->cpu_data()[data_permutation_[current_row_] 28 | * data_dim], &top[j]->mutable_gpu_data()[i * data_dim]); 29 | } 30 | Next(); 31 | } 32 | } 33 | 34 | INSTANTIATE_LAYER_GPU_FUNCS(HDF5DataLayer); 35 | 36 | } // namespace caffe 37 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/input_layer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/input_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | void InputLayer::LayerSetUp(const vector*>& bottom, 9 | const vector*>& top) { 10 | const int num_top = top.size(); 11 | const InputParameter& param = this->layer_param_.input_param(); 12 | const int num_shape = param.shape_size(); 13 | CHECK(num_shape == 0 || num_shape == 1 || num_shape == num_top) 14 | << "Must specify 'shape' once, once per top blob, or not at all: " 15 | << num_top << " tops vs. " << num_shape << " shapes."; 16 | if (num_shape > 0) { 17 | for (int i = 0; i < num_top; ++i) { 18 | const int shape_index = (param.shape_size() == 1) ? 0 : i; 19 | top[i]->Reshape(param.shape(shape_index)); 20 | } 21 | } 22 | } 23 | 24 | INSTANTIATE_CLASS(InputLayer); 25 | REGISTER_LAYER_CLASS(Input); 26 | 27 | } // namespace caffe 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/loss_layer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/loss_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | void LossLayer::LayerSetUp( 9 | const vector*>& bottom, const vector*>& top) { 10 | // LossLayers have a non-zero (1) loss by default. 11 | if (this->layer_param_.loss_weight_size() == 0) { 12 | this->layer_param_.add_loss_weight(Dtype(1)); 13 | } 14 | } 15 | 16 | template 17 | void LossLayer::Reshape( 18 | const vector*>& bottom, const vector*>& top) { 19 | CHECK_EQ(bottom[0]->shape(0), bottom[1]->shape(0)) 20 | << "The data and label should have the same first dimension."; 21 | vector loss_shape(0); // Loss layers output a scalar; 0 axes. 22 | top[0]->Reshape(loss_shape); 23 | } 24 | 25 | INSTANTIATE_CLASS(LossLayer); 26 | 27 | } // namespace caffe 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/neuron_layer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/neuron_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | void NeuronLayer::Reshape(const vector*>& bottom, 9 | const vector*>& top) { 10 | top[0]->ReshapeLike(*bottom[0]); 11 | } 12 | 13 | INSTANTIATE_CLASS(NeuronLayer); 14 | 15 | } // namespace caffe 16 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/parameter_layer.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/layers/parameter_layer.hpp" 2 | 3 | namespace caffe { 4 | 5 | INSTANTIATE_CLASS(ParameterLayer); 6 | REGISTER_LAYER_CLASS(Parameter); 7 | 8 | } // namespace caffe 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/silence_layer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/silence_layer.hpp" 4 | #include "caffe/util/math_functions.hpp" 5 | 6 | namespace caffe { 7 | 8 | template 9 | void SilenceLayer::Backward_cpu(const vector*>& top, 10 | const vector& propagate_down, const vector*>& bottom) { 11 | for (int i = 0; i < bottom.size(); ++i) { 12 | if (propagate_down[i]) { 13 | caffe_set(bottom[i]->count(), Dtype(0), 14 | bottom[i]->mutable_cpu_diff()); 15 | } 16 | } 17 | } 18 | 19 | #ifdef CPU_ONLY 20 | STUB_GPU(SilenceLayer); 21 | #endif 22 | 23 | INSTANTIATE_CLASS(SilenceLayer); 24 | REGISTER_LAYER_CLASS(Silence); 25 | 26 | } // namespace caffe 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/silence_layer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/silence_layer.hpp" 4 | #include "caffe/util/math_functions.hpp" 5 | 6 | namespace caffe { 7 | 8 | template 9 | void SilenceLayer::Forward_gpu(const vector*>& bottom, 10 | const vector*>& top) { 11 | // Do nothing. 12 | } 13 | 14 | template 15 | void SilenceLayer::Backward_gpu(const vector*>& top, 16 | const vector& propagate_down, const vector*>& bottom) { 17 | for (int i = 0; i < bottom.size(); ++i) { 18 | if (propagate_down[i]) { 19 | caffe_gpu_set(bottom[i]->count(), Dtype(0), 20 | bottom[i]->mutable_gpu_diff()); 21 | } 22 | } 23 | } 24 | 25 | INSTANTIATE_LAYER_GPU_FUNCS(SilenceLayer); 26 | 27 | } // namespace caffe 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/threshold_layer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/threshold_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | void ThresholdLayer::LayerSetUp(const vector*>& bottom, 9 | const vector*>& top) { 10 | NeuronLayer::LayerSetUp(bottom, top); 11 | threshold_ = this->layer_param_.threshold_param().threshold(); 12 | } 13 | 14 | template 15 | void ThresholdLayer::Forward_cpu(const vector*>& bottom, 16 | const vector*>& top) { 17 | const Dtype* bottom_data = bottom[0]->cpu_data(); 18 | Dtype* top_data = top[0]->mutable_cpu_data(); 19 | const int count = bottom[0]->count(); 20 | for (int i = 0; i < count; ++i) { 21 | top_data[i] = (bottom_data[i] > threshold_) ? Dtype(1) : Dtype(0); 22 | } 23 | } 24 | 25 | #ifdef CPU_ONLY 26 | STUB_GPU_FORWARD(ThresholdLayer, Forward); 27 | #endif 28 | 29 | INSTANTIATE_CLASS(ThresholdLayer); 30 | REGISTER_LAYER_CLASS(Threshold); 31 | 32 | } // namespace caffe 33 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/layers/threshold_layer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "caffe/layers/threshold_layer.hpp" 4 | 5 | namespace caffe { 6 | 7 | template 8 | __global__ void ThresholdForward(const int n, const Dtype threshold, 9 | const Dtype* in, Dtype* out) { 10 | CUDA_KERNEL_LOOP(index, n) { 11 | out[index] = in[index] > threshold ? 1 : 0; 12 | } 13 | } 14 | 15 | template 16 | void ThresholdLayer::Forward_gpu(const vector*>& bottom, 17 | const vector*>& top) { 18 | const Dtype* bottom_data = bottom[0]->gpu_data(); 19 | Dtype* top_data = top[0]->mutable_gpu_data(); 20 | const int count = bottom[0]->count(); 21 | // NOLINT_NEXT_LINE(whitespace/operators) 22 | ThresholdForward<<>>( 23 | count, threshold_, bottom_data, top_data); 24 | CUDA_POST_KERNEL_CHECK; 25 | } 26 | 27 | 28 | INSTANTIATE_LAYER_GPU_FORWARD(ThresholdLayer); 29 | 30 | 31 | } // namespace caffe 32 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/solvers/adagrad_solver.cu: -------------------------------------------------------------------------------- 1 | #include "caffe/util/math_functions.hpp" 2 | 3 | 4 | namespace caffe { 5 | 6 | template 7 | __global__ void AdaGradUpdate(int N, Dtype* g, Dtype* h, Dtype delta, 8 | Dtype local_rate) { 9 | CUDA_KERNEL_LOOP(i, N) { 10 | float gi = g[i]; 11 | float hi = h[i] = h[i] + gi*gi; 12 | g[i] = local_rate * gi / (sqrt(hi) + delta); 13 | } 14 | } 15 | template 16 | void adagrad_update_gpu(int N, Dtype* g, Dtype* h, Dtype delta, 17 | Dtype local_rate) { 18 | AdaGradUpdate // NOLINT_NEXT_LINE(whitespace/operators) 19 | <<>>( 20 | N, g, h, delta, local_rate); 21 | CUDA_POST_KERNEL_CHECK; 22 | } 23 | template void adagrad_update_gpu(int, float*, float*, float, float); 24 | template void adagrad_update_gpu(int, double*, double*, double, double); 25 | 26 | } // namespace caffe 27 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/solvers/nesterov_solver.cu: -------------------------------------------------------------------------------- 1 | #include "caffe/util/math_functions.hpp" 2 | 3 | 4 | namespace caffe { 5 | 6 | template 7 | __global__ void NesterovUpdate(int N, Dtype* g, Dtype* h, 8 | Dtype momentum, Dtype local_rate) { 9 | CUDA_KERNEL_LOOP(i, N) { 10 | float hi = h[i]; 11 | float hi_new = h[i] = momentum * hi + local_rate * g[i]; 12 | g[i] = (1+momentum) * hi_new - momentum * hi; 13 | } 14 | } 15 | template 16 | void nesterov_update_gpu(int N, Dtype* g, Dtype* h, Dtype momentum, 17 | Dtype local_rate) { 18 | NesterovUpdate // NOLINT_NEXT_LINE(whitespace/operators) 19 | <<>>( 20 | N, g, h, momentum, local_rate); 21 | CUDA_POST_KERNEL_CHECK; 22 | } 23 | template void nesterov_update_gpu(int, float*, float*, float, float); 24 | template void nesterov_update_gpu(int, double*, double*, double, 25 | double); 26 | 27 | } // namespace caffe 28 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/solvers/rmsprop_solver.cu: -------------------------------------------------------------------------------- 1 | #include "caffe/util/math_functions.hpp" 2 | 3 | 4 | namespace caffe { 5 | 6 | template 7 | __global__ void RMSPropUpdate(int N, Dtype* g, Dtype* h, 8 | Dtype rms_decay, Dtype delta, Dtype local_rate) { 9 | CUDA_KERNEL_LOOP(i, N) { 10 | float gi = g[i]; 11 | float hi = h[i] = rms_decay*h[i] + (1-rms_decay)*gi*gi; 12 | g[i] = local_rate * g[i] / (sqrt(hi) + delta); 13 | } 14 | } 15 | template 16 | void rmsprop_update_gpu(int N, Dtype* g, Dtype* h, Dtype rms_decay, 17 | Dtype delta, Dtype local_rate) { 18 | RMSPropUpdate // NOLINT_NEXT_LINE(whitespace/operators) 19 | <<>>( 20 | N, g, h, rms_decay, delta, local_rate); 21 | CUDA_POST_KERNEL_CHECK; 22 | } 23 | template void rmsprop_update_gpu(int, float*, float*, float, float, 24 | float); 25 | template void rmsprop_update_gpu(int, double*, double*, double, double, 26 | double); 27 | 28 | } // namespace caffe 29 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/solvers/sgd_solver.cu: -------------------------------------------------------------------------------- 1 | #include "caffe/util/math_functions.hpp" 2 | 3 | 4 | namespace caffe { 5 | 6 | template 7 | __global__ void SGDUpdate(int N, Dtype* g, Dtype* h, 8 | Dtype momentum, Dtype local_rate) { 9 | CUDA_KERNEL_LOOP(i, N) { 10 | g[i] = h[i] = momentum*h[i] + local_rate*g[i]; 11 | } 12 | } 13 | template 14 | void sgd_update_gpu(int N, Dtype* g, Dtype* h, Dtype momentum, 15 | Dtype local_rate) { 16 | SGDUpdate // NOLINT_NEXT_LINE(whitespace/operators) 17 | <<>>( 18 | N, g, h, momentum, local_rate); 19 | CUDA_POST_KERNEL_CHECK; 20 | } 21 | template void sgd_update_gpu(int, float*, float*, float, float); 22 | template void sgd_update_gpu(int, double*, double*, double, double); 23 | 24 | } // namespace caffe 25 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_data/sample_data.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/src/caffe/test/test_data/sample_data.h5 -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_data/sample_data_2_gzip.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/src/caffe/test/test_data/sample_data_2_gzip.h5 -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_data/sample_data_list.txt: -------------------------------------------------------------------------------- 1 | src/caffe/test/test_data/sample_data.h5 2 | src/caffe/test/test_data/sample_data_2_gzip.h5 3 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_data/solver_data.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/caffe/src/caffe/test/test_data/solver_data.h5 -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_data/solver_data_list.txt: -------------------------------------------------------------------------------- 1 | src/caffe/test/test_data/solver_data.h5 2 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/test/test_protobuf.cpp: -------------------------------------------------------------------------------- 1 | // This is simply a script that tries serializing protocol buffer in text 2 | // format. Nothing special here and no actual code is being tested. 3 | #include 4 | 5 | #include "google/protobuf/text_format.h" 6 | #include "gtest/gtest.h" 7 | 8 | #include "caffe/proto/caffe.pb.h" 9 | 10 | #include "caffe/test/test_caffe_main.hpp" 11 | 12 | namespace caffe { 13 | 14 | class ProtoTest : public ::testing::Test {}; 15 | 16 | TEST_F(ProtoTest, TestSerialization) { 17 | LayerParameter param; 18 | param.set_name("test"); 19 | param.set_type("Test"); 20 | std::cout << "Printing in binary format." << std::endl; 21 | std::cout << param.SerializeAsString() << std::endl; 22 | std::cout << "Printing in text format." << std::endl; 23 | std::string str; 24 | google::protobuf::TextFormat::PrintToString(param, &str); 25 | std::cout << str << std::endl; 26 | EXPECT_TRUE(true); 27 | } 28 | 29 | } // namespace caffe 30 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/util/cudnn.cpp: -------------------------------------------------------------------------------- 1 | #ifdef USE_CUDNN 2 | #include "caffe/util/cudnn.hpp" 3 | 4 | namespace caffe { 5 | namespace cudnn { 6 | 7 | float dataType::oneval = 1.0; 8 | float dataType::zeroval = 0.0; 9 | const void* dataType::one = 10 | static_cast(&dataType::oneval); 11 | const void* dataType::zero = 12 | static_cast(&dataType::zeroval); 13 | 14 | double dataType::oneval = 1.0; 15 | double dataType::zeroval = 0.0; 16 | const void* dataType::one = 17 | static_cast(&dataType::oneval); 18 | const void* dataType::zero = 19 | static_cast(&dataType::zeroval); 20 | 21 | } // namespace cudnn 22 | } // namespace caffe 23 | #endif 24 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/util/db.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/util/db.hpp" 2 | #include "caffe/util/db_leveldb.hpp" 3 | #include "caffe/util/db_lmdb.hpp" 4 | 5 | #include 6 | 7 | namespace caffe { namespace db { 8 | 9 | DB* GetDB(DataParameter::DB backend) { 10 | switch (backend) { 11 | #ifdef USE_LEVELDB 12 | case DataParameter_DB_LEVELDB: 13 | return new LevelDB(); 14 | #endif // USE_LEVELDB 15 | #ifdef USE_LMDB 16 | case DataParameter_DB_LMDB: 17 | return new LMDB(); 18 | #endif // USE_LMDB 19 | default: 20 | LOG(FATAL) << "Unknown database backend"; 21 | return NULL; 22 | } 23 | } 24 | 25 | DB* GetDB(const string& backend) { 26 | #ifdef USE_LEVELDB 27 | if (backend == "leveldb") { 28 | return new LevelDB(); 29 | } 30 | #endif // USE_LEVELDB 31 | #ifdef USE_LMDB 32 | if (backend == "lmdb") { 33 | return new LMDB(); 34 | } 35 | #endif // USE_LMDB 36 | LOG(FATAL) << "Unknown database backend"; 37 | return NULL; 38 | } 39 | 40 | } // namespace db 41 | } // namespace caffe 42 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/caffe/util/db_leveldb.cpp: -------------------------------------------------------------------------------- 1 | #ifdef USE_LEVELDB 2 | #include "caffe/util/db_leveldb.hpp" 3 | 4 | #include 5 | 6 | namespace caffe { namespace db { 7 | 8 | void LevelDB::Open(const string& source, Mode mode) { 9 | leveldb::Options options; 10 | options.block_size = 65536; 11 | options.write_buffer_size = 268435456; 12 | options.max_open_files = 100; 13 | options.error_if_exists = mode == NEW; 14 | options.create_if_missing = mode != READ; 15 | leveldb::Status status = leveldb::DB::Open(options, source, &db_); 16 | CHECK(status.ok()) << "Failed to open leveldb " << source 17 | << std::endl << status.ToString(); 18 | LOG(INFO) << "Opened leveldb " << source; 19 | } 20 | 21 | } // namespace db 22 | } // namespace caffe 23 | #endif // USE_LEVELDB 24 | -------------------------------------------------------------------------------- /3rdparty/caffe/src/gtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(gtest STATIC EXCLUDE_FROM_ALL gtest.h gtest-all.cpp) 2 | caffe_default_properties(gtest) 3 | target_include_directories(gtest PUBLIC ${Caffe_SRC_DIR}) 4 | target_compile_definitions(gtest PUBLIC -DGTEST_USE_OWN_TR1_TUPLE) 5 | 6 | 7 | #add_library(gtest_main gtest_main.cc) 8 | #target_link_libraries(gtest_main gtest) 9 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Collect source files 2 | file(GLOB_RECURSE srcs ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) 3 | 4 | # Build each source file independently 5 | foreach(source ${srcs}) 6 | get_filename_component(name ${source} NAME_WE) 7 | 8 | # caffe target already exits 9 | if(name MATCHES "caffe") 10 | set(name ${name}.bin) 11 | endif() 12 | 13 | # target 14 | add_executable(${name} ${source}) 15 | target_link_libraries(${name} ${Caffe_LINK}) 16 | caffe_default_properties(${name}) 17 | 18 | # set back RUNTIME_OUTPUT_DIRECTORY 19 | caffe_set_runtime_directory(${name} "${PROJECT_BINARY_DIR}/tools") 20 | caffe_set_solution_folder(${name} tools) 21 | 22 | # restore output name without suffix 23 | if(name MATCHES "caffe.bin") 24 | set_target_properties(${name} PROPERTIES OUTPUT_NAME caffe) 25 | endif() 26 | 27 | # Install 28 | install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR}) 29 | 30 | endforeach(source) 31 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/device_query.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/common.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | LOG(FATAL) << "Deprecated. Use caffe device_query " 5 | "[--device_id=0] instead."; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/finetune_net.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/caffe.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | LOG(FATAL) << "Deprecated. Use caffe train --solver=... " 5 | "[--weights=...] instead."; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/net_speed_benchmark.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/caffe.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | LOG(FATAL) << "Deprecated. Use caffe time --model=... " 5 | "[--iterations=50] [--gpu] [--device_id=0]"; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/test_net.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/caffe.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | LOG(FATAL) << "Deprecated. Use caffe test --model=... " 5 | "--weights=... instead."; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/caffe/tools/train_net.cpp: -------------------------------------------------------------------------------- 1 | #include "caffe/caffe.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | LOG(FATAL) << "Deprecated. Use caffe train --solver=... " 5 | "[--snapshot=...] instead."; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/windows/getCaffe.bat: -------------------------------------------------------------------------------- 1 | :: Avoid printing all the comments in the Windows cmd 2 | @echo off 3 | 4 | SET UNZIP_EXE=unzip\unzip.exe 5 | SET WGET_EXE=wget\wget.exe 6 | 7 | :: Download temporary zip 8 | echo ----- Downloading Caffe ----- 9 | SET CAFEE_FOLDER=caffe\ 10 | SET ZIP_NAME=caffe_2017_07_11.zip 11 | SET ZIP_FULL_PATH=%CAFEE_FOLDER%%ZIP_NAME% 12 | %WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %CAFEE_FOLDER% 13 | echo: 14 | 15 | echo ----- Unzipping Caffe ----- 16 | %UNZIP_EXE% %ZIP_FULL_PATH% 17 | echo: 18 | 19 | echo ----- Deleting Temporary Zip File %ZIP_FULL_PATH% ----- 20 | del "%ZIP_FULL_PATH%" 21 | 22 | echo ----- Caffe Downloaded and Unzipped ----- 23 | -------------------------------------------------------------------------------- /3rdparty/windows/getCaffe3rdparty.bat: -------------------------------------------------------------------------------- 1 | :: Avoid printing all the comments in the Windows cmd 2 | @echo off 3 | 4 | SET UNZIP_EXE=unzip\unzip.exe 5 | SET WGET_EXE=wget\wget.exe 6 | 7 | :: Download temporary zip 8 | echo ----- Downloading Caffe ----- 9 | SET CAFEE_FOLDER=caffe3rdparty\ 10 | SET ZIP_NAME=caffe3rdparty_2017_07_14.zip 11 | SET ZIP_FULL_PATH=%CAFEE_FOLDER%%ZIP_NAME% 12 | %WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %CAFEE_FOLDER% 13 | echo: 14 | 15 | echo ----- Unzipping Caffe ----- 16 | %UNZIP_EXE% %ZIP_FULL_PATH% 17 | echo: 18 | 19 | echo ----- Deleting Temporary Zip File %ZIP_FULL_PATH% ----- 20 | del "%ZIP_FULL_PATH%" 21 | 22 | echo ----- Caffe Downloaded and Unzipped ----- 23 | -------------------------------------------------------------------------------- /3rdparty/windows/getOpenCV.bat: -------------------------------------------------------------------------------- 1 | :: Avoid printing all the comments in the Windows cmd 2 | @echo off 3 | 4 | SET UNZIP_EXE=unzip\unzip.exe 5 | SET WGET_EXE=wget\wget.exe 6 | 7 | :: Download temporary zip 8 | echo ----- Downloading OpenCV ----- 9 | SET OPENCV_FOLDER=opencv\ 10 | SET ZIP_NAME=opencv_310.zip 11 | SET ZIP_FULL_PATH=%OPENCV_FOLDER%%ZIP_NAME% 12 | %WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %OPENCV_FOLDER% 13 | echo: 14 | 15 | echo ----- Unzipping OpenCV ----- 16 | %UNZIP_EXE% %ZIP_FULL_PATH% 17 | echo: 18 | 19 | echo ----- Deleting Temporary Zip File %ZIP_FULL_PATH% ----- 20 | del "%ZIP_FULL_PATH%" 21 | 22 | echo ----- OpenCV Downloaded and Unzipped ----- 23 | -------------------------------------------------------------------------------- /3rdparty/windows/unzip/LICENSE.txt: -------------------------------------------------------------------------------- 1 | http://www.info-zip.org/license.html 2 | -------------------------------------------------------------------------------- /3rdparty/windows/unzip/unzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/windows/unzip/unzip.exe -------------------------------------------------------------------------------- /3rdparty/windows/wget/Version_wget-1.19.1-win64.txt: -------------------------------------------------------------------------------- 1 | Version wget-1.19.1-win64 from: 2 | - https://eternallybored.org/misc/wget/ 3 | -------------------------------------------------------------------------------- /3rdparty/windows/wget/wget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/windows/wget/wget.exe -------------------------------------------------------------------------------- /3rdparty/windows/wget/wget.exe.debug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/3rdparty/windows/wget/wget.exe.debug -------------------------------------------------------------------------------- /doc/GUI_help/GUI_help.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/GUI_help/GUI_help.odt -------------------------------------------------------------------------------- /doc/GUI_help/GUI_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/GUI_help/GUI_help.png -------------------------------------------------------------------------------- /doc/UML/1_0_0rc3/UML.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/UML/1_0_0rc3/UML.pdf -------------------------------------------------------------------------------- /doc/UML/1_0_0rc3/UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/UML/1_0_0rc3/UML.png -------------------------------------------------------------------------------- /doc/contributors.md: -------------------------------------------------------------------------------- 1 | OpenPose - Authors and Contributors 2 | ==================================== 3 | 4 | 5 | 6 | ### Authors 7 | OpenPose is authored by [Gines Hidalgo](https://www.linkedin.com/in/gineshidalgo/), [Zhe Cao](http://www.andrew.cmu.edu/user/zhecao), [Tomas Simon](http://www.cs.cmu.edu/~tsimon/), [Shih-En Wei](https://scholar.google.com/citations?user=sFQD3k4AAAAJ&hl=en), [Hanbyul Joo](http://www.cs.cmu.edu/~hanbyulj/) and [Yaser Sheikh](http://www.cs.cmu.edu/~yaser/). 8 | 9 | 10 | 11 | ### Contributors 12 | We would also like to thank the following people who have highly contributed to OpenPose: 13 | 14 | 1. [Helen Medina](https://github.com/helen-medina): Original Windows branch creator. She did the first stable OpenPose version on Windows. 15 | -------------------------------------------------------------------------------- /doc/media/body_heat_maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/body_heat_maps.png -------------------------------------------------------------------------------- /doc/media/dance.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/dance.gif -------------------------------------------------------------------------------- /doc/media/keypoints_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/keypoints_face.png -------------------------------------------------------------------------------- /doc/media/keypoints_hand.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/keypoints_hand.odt -------------------------------------------------------------------------------- /doc/media/keypoints_hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/keypoints_hand.png -------------------------------------------------------------------------------- /doc/media/keypoints_pose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/keypoints_pose.png -------------------------------------------------------------------------------- /doc/media/openpose3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/openpose3d.png -------------------------------------------------------------------------------- /doc/media/paf_heat_maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/paf_heat_maps.png -------------------------------------------------------------------------------- /doc/media/pose_face.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/pose_face.gif -------------------------------------------------------------------------------- /doc/media/pose_face_hands.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/pose_face_hands.gif -------------------------------------------------------------------------------- /doc/media/pose_hands.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/pose_hands.gif -------------------------------------------------------------------------------- /doc/media/shake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/doc/media/shake.gif -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000192.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000192.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000241.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000241.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000257.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000257.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000294.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000294.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000328.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000328.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000338.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000338.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000357.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000357.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000360.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000360.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000395.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000395.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000415.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000415.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000428.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000428.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000459.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000459.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000474.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000474.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000488.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000488.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000536.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000536.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000544.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000544.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000564.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000564.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000569.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000569.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000589.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000589.jpg -------------------------------------------------------------------------------- /examples/media/COCO_val2014_000000000623.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/COCO_val2014_000000000623.jpg -------------------------------------------------------------------------------- /examples/media/video.avi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/media/video.avi -------------------------------------------------------------------------------- /examples/tests/pose_time_Caffe_layers.sh: -------------------------------------------------------------------------------- 1 | # Script for internal use. We might completely change it continuously and we will not answer questions about it. 2 | 3 | # # Go back to main folder 4 | # cd ../../ 5 | 6 | # Performance results 7 | PROTOTXT_PATH=/home/gines/Dropbox/Perceptual_Computing_Lab/openpose/openpose/models/pose/coco/pose_deploy_linevec.prototxt 8 | 9 | gedit $0 10 | # First: Add 656 x 368 as input_dim in: 11 | gedit $PROTOTXT_PATH 12 | ./3rdparty/caffe/build/tools/caffe time -model $PROTOTXT_PATH -gpu 0 -phase TEST 13 | gedit $PROTOTXT_PATH 14 | -------------------------------------------------------------------------------- /examples/tests/pose_time_visual_GUI.sh: -------------------------------------------------------------------------------- 1 | # Script for internal use. We might completely change it continuously and we will not answer questions about it. 2 | 3 | # # Go back to main folder 4 | # cd ../../ 5 | 6 | # Re-build 7 | clear && clear && make all -j12 8 | 9 | # Performance results (~1400) 10 | ./build/examples/openpose/openpose.bin --video soccer.mp4 --frame_last 1500 11 | # Including 2nd graphics card (~3500) 12 | # ./build/examples/openpose/openpose.bin --video soccer.mp4 --frame_last 3750 13 | -------------------------------------------------------------------------------- /examples/user_code/User custom files here will compile, try not to modify the CPM source code: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peisuke/openpose/382b96110ea8f4ff812b1dcf9dddcf0be1c23f1c/examples/user_code/User custom files here will compile, try not to modify the CPM source code -------------------------------------------------------------------------------- /examples_beta/openpose3d/include/openpose3d/datum3D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE3D_DATUM_3D_HPP 2 | #define OPENPOSE3D_DATUM_3D_HPP 3 | 4 | #include 5 | #include 6 | 7 | // Following OpenPose `tutorial_wrapper/` examples, we create our own class inherited from Datum 8 | // See `examples/tutorial_wrapper/` for more details 9 | struct Datum3D : public op::Datum 10 | { 11 | op::Array poseKeypoints3D; 12 | op::Array faceKeypoints3D; 13 | op::Array leftHandKeypoints3D; 14 | op::Array rightHandKeypoints3D; 15 | }; 16 | 17 | #endif // OPENPOSE3D_DATUM_3D_HPP 18 | -------------------------------------------------------------------------------- /examples_beta/openpose3d/include/openpose3d/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE3D_HEADERS_HPP 2 | #define OPENPOSE3D_HEADERS_HPP 3 | 4 | // Camera intrinsic and extrinsic parameters 5 | #include 6 | // Datum3D 7 | #include 8 | // PointGrey cameras 9 | #include 10 | // 3D reconstruction 11 | #include 12 | // OpenGL Renderer 13 | #include 14 | 15 | #endif // OPENPOSE3D_HEADERS_HPP 16 | -------------------------------------------------------------------------------- /examples_beta/openpose3d/include/openpose3d/reconstruction3D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef RECONSTRUCTION_3D_HPP 2 | #define RECONSTRUCTION_3D_HPP 3 | 4 | #include 5 | 6 | // Following OpenPose `tutorial_wrapper/` examples, we create our own class inherited from Worker. 7 | // This worker will do 3-D reconstruction 8 | // We apply the simple Direct linear transformation (DLT) algorithm, asumming each keypoint (e.g. right hip) is seen by all the cameras. 9 | // No non-linear minimization used, and if some camera misses the point, it is not reconstructed. 10 | // See `examples/tutorial_wrapper/` for more details about inhering the Worker class and using it for post-processing purposes. 11 | class WReconstruction3D : public op::Worker>> 12 | { 13 | public: 14 | void initializationOnThread() {} 15 | 16 | void work(std::shared_ptr>& datumsPtr); 17 | }; 18 | 19 | #endif // RECONSTRUCTION_3D_HPP 20 | -------------------------------------------------------------------------------- /examples_beta/openpose3d/include/openpose3d/renderer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE3D_RENDERER_HPP 2 | #define OPENPOSE3D_RENDERER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // This worker will do 3-D rendering 10 | class WRender3D : public op::WorkerConsumer>> 11 | { 12 | public: 13 | WRender3D(const op::PoseModel poseModel = op::PoseModel::COCO_18); 14 | 15 | void initializationOnThread() {} 16 | 17 | void workConsumer(const std::shared_ptr>& datumsPtr); 18 | 19 | private: 20 | std::thread mRenderThread; 21 | 22 | void visualizationThread(); 23 | }; 24 | 25 | #endif // OPENPOSE3D_RENDERER_HPP 26 | -------------------------------------------------------------------------------- /include/openpose/core/common.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_COMMON_HPP 2 | #define OPENPOSE_CORE_COMMON_HPP 3 | 4 | // Std library most used classes 5 | #include 6 | #include // std::shared_ptr 7 | #include 8 | #include 9 | // OpenPose most used classes 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | // Macros at the end, otherwise circular dependency with array, point & rectangle 16 | #include 17 | 18 | #endif // OPENPOSE_CORE_COMMON_HPP 19 | -------------------------------------------------------------------------------- /include/openpose/core/cvMatToOpInput.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_CV_MAT_TO_OP_INPUT_HPP 2 | #define OPENPOSE_CORE_CV_MAT_TO_OP_INPUT_HPP 3 | 4 | #include // std::pair 5 | #include // cv::Mat 6 | #include 7 | 8 | namespace op 9 | { 10 | class OP_API CvMatToOpInput 11 | { 12 | public: 13 | CvMatToOpInput(const Point& netInputResolution, const int scaleNumber = 1, const float scaleGap = 0.25); 14 | 15 | std::pair, std::vector> format(const cv::Mat& cvInputData) const; 16 | 17 | private: 18 | const int mScaleNumber; 19 | const float mScaleGap; 20 | const std::vector mInputNetSize4D; 21 | }; 22 | } 23 | 24 | #endif // OPENPOSE_CORE_CV_MAT_TO_OP_INPUT_HPP 25 | -------------------------------------------------------------------------------- /include/openpose/core/cvMatToOpOutput.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_CV_MAT_TO_OP_OUTPUT_HPP 2 | #define OPENPOSE_CORE_CV_MAT_TO_OP_OUTPUT_HPP 3 | 4 | #include // cv::Mat 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API CvMatToOpOutput 10 | { 11 | public: 12 | CvMatToOpOutput(const Point& outputResolution, const bool generateOutput = true); 13 | 14 | std::tuple> format(const cv::Mat& cvInputData) const; 15 | 16 | private: 17 | const bool mGenerateOutput; 18 | const std::vector mOutputSize3D; 19 | }; 20 | } 21 | 22 | #endif // OPENPOSE_CORE_CV_MAT_TO_OP_OUTPUT_HPP 23 | -------------------------------------------------------------------------------- /include/openpose/core/enumClasses.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_ENUM_CLASSES_HPP 2 | #define OPENPOSE_CORE_ENUM_CLASSES_HPP 3 | 4 | namespace op 5 | { 6 | enum class ScaleMode : unsigned char 7 | { 8 | InputResolution, 9 | NetOutputResolution, 10 | OutputResolution, 11 | ZeroToOne, // [0, 1] 12 | PlusMinusOne, // [-1, 1] 13 | UnsignedChar, // [0, 255] 14 | }; 15 | 16 | enum class HeatMapType : unsigned char 17 | { 18 | Parts, 19 | Background, 20 | PAFs, 21 | }; 22 | 23 | enum class RenderMode : unsigned char 24 | { 25 | None, 26 | Cpu, 27 | Gpu, 28 | }; 29 | } 30 | 31 | #endif // OPENPOSE_CORE_ENUM_CLASSES_HPP 32 | -------------------------------------------------------------------------------- /include/openpose/core/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_HEADERS_HPP 2 | #define OPENPOSE_CORE_HEADERS_HPP 3 | 4 | // core module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif // OPENPOSE_CORE_HEADERS_HPP 29 | -------------------------------------------------------------------------------- /include/openpose/core/keypointScaler.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_KEYPOINT_SCALER_HPP 2 | #define OPENPOSE_CORE_KEYPOINT_SCALER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API KeypointScaler 10 | { 11 | public: 12 | explicit KeypointScaler(const ScaleMode scaleMode); 13 | 14 | void scale(Array& arrayToScale, const float scaleInputToOutput, const float scaleNetToOutput, const Point& producerSize) const; 15 | 16 | void scale(std::vector>& arraysToScale, const float scaleInputToOutput, const float scaleNetToOutput, const Point& producerSize) const; 17 | 18 | private: 19 | const ScaleMode mScaleMode; 20 | }; 21 | } 22 | 23 | #endif // OPENPOSE_CORE_KEYPOINT_SCALER_HPP 24 | -------------------------------------------------------------------------------- /include/openpose/core/maximumBase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_MAXIMUM_BASE_HPP 2 | #define OPENPOSE_CORE_MAXIMUM_BASE_HPP 3 | 4 | #include 5 | 6 | namespace op 7 | { 8 | template 9 | OP_API void maximumCpu(T* targetPtr, const T* const sourcePtr, const std::array& targetSize, const std::array& sourceSize); 10 | 11 | #ifdef CPU_ONLY 12 | template 13 | OP_API void maximumGpu(T* targetPtr, const T* const sourcePtr, const std::array& targetSize, const std::array& sourceSize); 14 | #endif 15 | } 16 | 17 | #endif // OPENPOSE_CORE_MAXIMUM_BASE_HPP 18 | -------------------------------------------------------------------------------- /include/openpose/core/net.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_NET_HPP 2 | #define OPENPOSE_CORE_NET_HPP 3 | 4 | #include 5 | 6 | namespace op 7 | { 8 | class OP_API Net 9 | { 10 | public: 11 | virtual void initializationOnThread() = 0; 12 | 13 | // Alternative a) getInputDataCpuPtr or getInputDataGpuPtr + forwardPass() 14 | virtual float* getInputDataCpuPtr() const = 0; 15 | 16 | virtual float* getInputDataGpuPtr() const = 0; 17 | 18 | // Alternative b) 19 | virtual void forwardPass(const float* const inputData = nullptr) const = 0; 20 | }; 21 | } 22 | 23 | #endif // OPENPOSE_CORE_NET_HPP 24 | -------------------------------------------------------------------------------- /include/openpose/core/nmsBase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_NMS_BASE_HPP 2 | #define OPENPOSE_CORE_NMS_BASE_HPP 3 | 4 | #include 5 | 6 | namespace op 7 | { 8 | template 9 | OP_API void nmsCpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array& targetSize, const std::array& sourceSize); 10 | 11 | #ifndef CPU_ONLY 12 | template 13 | OP_API void nmsGpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array& targetSize, const std::array& sourceSize); 14 | #endif 15 | } 16 | 17 | #endif // OPENPOSE_CORE_NMS_BASE_HPP 18 | -------------------------------------------------------------------------------- /include/openpose/core/opOutputToCvMat.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_OP_OUTPUT_TO_CV_MAT_HPP 2 | #define OPENPOSE_CORE_OP_OUTPUT_TO_CV_MAT_HPP 3 | 4 | #include // cv::Mat 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API OpOutputToCvMat 10 | { 11 | public: 12 | explicit OpOutputToCvMat(const Point& outputResolution); 13 | 14 | cv::Mat formatToCvMat(const Array& outputData) const; 15 | 16 | private: 17 | const Point mOutputResolution; 18 | }; 19 | } 20 | 21 | #endif // OPENPOSE_CORE_OP_OUTPUT_TO_CV_MAT_HPP 22 | -------------------------------------------------------------------------------- /include/openpose/core/resizeAndMergeBase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_CORE_RESIZE_AND_MERGE_BASE_HPP 2 | #define OPENPOSE_CORE_RESIZE_AND_MERGE_BASE_HPP 3 | 4 | #include 5 | 6 | namespace op 7 | { 8 | template 9 | OP_API void resizeAndMergeCpu(T* targetPtr, const T* const sourcePtr, const std::array& targetSize, const std::array& sourceSize, 10 | const std::vector& scaleRatios = {1}); 11 | 12 | #ifndef CPU_ONLY 13 | template 14 | OP_API void resizeAndMergeGpu(T* targetPtr, const T* const sourcePtr, const std::array& targetSize, const std::array& sourceSize, 15 | const std::vector& scaleRatios = {1}); 16 | #endif 17 | } 18 | 19 | #endif // OPENPOSE_CORE_RESIZE_AND_MERGE_BASE_HPP 20 | -------------------------------------------------------------------------------- /include/openpose/experimental/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_EXPERIMENTAL_HEADERS_HPP 2 | #define OPENPOSE_EXPERIMENTAL_HEADERS_HPP 3 | 4 | // producer module 5 | // #include 6 | 7 | #endif // OPENPOSE_EXPERIMENTAL_HEADERS_HPP 8 | -------------------------------------------------------------------------------- /include/openpose/experimental/producer/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_EXPERIMENTAL_PRODUCER_HEADERS_HPP 2 | #define OPENPOSE_EXPERIMENTAL_PRODUCER_HEADERS_HPP 3 | 4 | // producer module 5 | // #include 6 | 7 | #endif // OPENPOSE_EXPERIMENTAL_PRODUCER_HEADERS_HPP 8 | -------------------------------------------------------------------------------- /include/openpose/experimental/producer/wPeoplePoseLoader.hpp: -------------------------------------------------------------------------------- 1 | // TODO: IMPLEMENT THIS CLASS so that we can: 2 | // 1. Pre-process whole video and save people pose 3 | // 2. Real-time showing it by loading this + original video 4 | 5 | // #ifndef OPENPOSE_PRODUCER_W_POSE_LOADER_HPP 6 | // #define OPENPOSE_PRODUCER_W_POSE_LOADER_HPP 7 | 8 | // namespace op 9 | // { 10 | // template 11 | // class wPoseLoader : public Worker 12 | // { 13 | // public: 14 | // explicit WPoseLoader() 15 | // { 16 | // } 17 | // bool work(TDatums& datums, const bool isValidFrame) 18 | // { 19 | // } 20 | 21 | // private: 22 | // const WPoseLoader mFormat; 23 | // }; 24 | 25 | // COMPILE_TEMPLATE_DATUM(WPoseLoader); 26 | // } 27 | 28 | // #endif // OPENPOSE_PRODUCER_W_POSE_LOADER_HPP 29 | -------------------------------------------------------------------------------- /include/openpose/face/faceDetector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FACE_FACE_DETECTOR_HPP 2 | #define OPENPOSE_FACE_FACE_DETECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API FaceDetector 10 | { 11 | public: 12 | explicit FaceDetector(const PoseModel poseModel); 13 | 14 | std::vector> detectFaces(const Array& poseKeypoints, const float scaleInputToOutput) const; 15 | 16 | private: 17 | const unsigned int mNeck; 18 | const unsigned int mNose; 19 | const unsigned int mLEar; 20 | const unsigned int mREar; 21 | const unsigned int mLEye; 22 | const unsigned int mREye; 23 | 24 | DELETE_COPY(FaceDetector); 25 | }; 26 | } 27 | 28 | #endif // OPENPOSE_FACE_FACE_DETECTOR_HPP 29 | -------------------------------------------------------------------------------- /include/openpose/face/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FACE_HEADERS_HPP 2 | #define OPENPOSE_FACE_HEADERS_HPP 3 | 4 | // face module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif // OPENPOSE_FACE_HEADERS_HPP 15 | -------------------------------------------------------------------------------- /include/openpose/face/renderFace.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FACE_RENDER_FACE_HPP 2 | #define OPENPOSE_FACE_RENDER_FACE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | OP_API void renderFaceKeypointsCpu(Array& frameArray, const Array& faceKeypoints, const float renderThreshold); 10 | 11 | OP_API void renderFaceKeypointsGpu(float* framePtr, const Point& frameSize, const float* const facePtr, const int numberPeople, 12 | const float renderThreshold, const float alphaColorToAdd = FACE_DEFAULT_ALPHA_KEYPOINT); 13 | } 14 | 15 | #endif // OPENPOSE_FACE_RENDER_FACE_HPP 16 | -------------------------------------------------------------------------------- /include/openpose/filestream/enumClasses.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_ENUM_CLASSES_HPP 2 | #define OPENPOSE_FILESTREAM_ENUM_CLASSES_HPP 3 | 4 | namespace op 5 | { 6 | enum class DataFormat : unsigned char 7 | { 8 | Json, 9 | Xml, 10 | Yaml, 11 | Yml, 12 | }; 13 | } 14 | 15 | #endif // OPENPOSE_FILESTREAM_ENUM_CLASSES_HPP 16 | -------------------------------------------------------------------------------- /include/openpose/filestream/fileSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_DATA_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_DATA_SAVER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API FileSaver 10 | { 11 | protected: 12 | explicit FileSaver(const std::string& directoryPath); 13 | 14 | std::string getNextFileName(const unsigned long long index) const; 15 | 16 | std::string getNextFileName(const std::string& fileNameNoExtension) const; 17 | 18 | private: 19 | const std::string mDirectoryPath; 20 | }; 21 | } 22 | 23 | #endif // OPENPOSE_FILESTREAM_DATA_SAVER_HPP 24 | -------------------------------------------------------------------------------- /include/openpose/filestream/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_HEADERS_HPP 2 | #define OPENPOSE_FILESTREAM_HEADERS_HPP 3 | 4 | // fileStream module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #endif // OPENPOSE_FILESTREAM_HEADERS_HPP 25 | -------------------------------------------------------------------------------- /include/openpose/filestream/heatMapSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_HEAT_MAP_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_HEAT_MAP_SAVER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API HeatMapSaver : public FileSaver 10 | { 11 | public: 12 | HeatMapSaver(const std::string& directoryPath, const std::string& imageFormat); 13 | 14 | void saveHeatMaps(const std::vector>& heatMaps, const std::string& fileName) const; 15 | 16 | private: 17 | const std::string mImageFormat; 18 | }; 19 | } 20 | 21 | #endif // OPENPOSE_FILESTREAM_HEAT_MAP_SAVER_HPP 22 | -------------------------------------------------------------------------------- /include/openpose/filestream/imageSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_IMAGE_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_IMAGE_SAVER_HPP 3 | 4 | #include // cv::Mat 5 | #include 6 | #include 7 | 8 | namespace op 9 | { 10 | class OP_API ImageSaver : public FileSaver 11 | { 12 | public: 13 | ImageSaver(const std::string& directoryPath, const std::string& imageFormat); 14 | 15 | void saveImages(const std::vector& cvOutputDatas, const std::string& fileName) const; 16 | 17 | private: 18 | const std::string mImageFormat; 19 | }; 20 | } 21 | 22 | #endif // OPENPOSE_FILESTREAM_IMAGE_SAVER_HPP 23 | -------------------------------------------------------------------------------- /include/openpose/filestream/keypointJsonSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_KEYPOINT_JSON_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_KEYPOINT_JSON_SAVER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API KeypointJsonSaver : public FileSaver 10 | { 11 | public: 12 | KeypointJsonSaver(const std::string& directoryPath); 13 | 14 | void save(const std::vector, std::string>>& keypointVector, 15 | const std::string& fileName, const bool humanReadable = true) const; 16 | }; 17 | } 18 | 19 | #endif // OPENPOSE_FILESTREAM_KEYPOINT_JSON_SAVER_HPP 20 | -------------------------------------------------------------------------------- /include/openpose/filestream/keypointSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_KEYPOINT_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_KEYPOINT_SAVER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace op 9 | { 10 | class OP_API KeypointSaver : public FileSaver 11 | { 12 | public: 13 | KeypointSaver(const std::string& directoryPath, const DataFormat format); 14 | 15 | void saveKeypoints(const std::vector>& keypointVector, const std::string& fileName, const std::string& keypointName) const; 16 | 17 | private: 18 | const DataFormat mFormat; 19 | }; 20 | } 21 | 22 | #endif // OPENPOSE_FILESTREAM_KEYPOINT_SAVER_HPP 23 | -------------------------------------------------------------------------------- /include/openpose/filestream/videoSaver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_FILESTREAM_VIDEO_SAVER_HPP 2 | #define OPENPOSE_FILESTREAM_VIDEO_SAVER_HPP 3 | 4 | #include // cv::Mat 5 | #include // cv::VideoWriter 6 | #include 7 | 8 | namespace op 9 | { 10 | class OP_API VideoSaver 11 | { 12 | public: 13 | VideoSaver(const std::string& videoSaverPath, const int cvFourcc, const double fps, const Point& cvSize); 14 | 15 | VideoSaver(const std::vector& videoSaverPaths, const int cvFourcc, const double fps, const Point& cvSize); 16 | 17 | bool isOpened(); 18 | 19 | void write(const cv::Mat& cvMat); 20 | 21 | void write(const std::vector& cvMats); 22 | 23 | private: 24 | std::vector mVideoWriters; 25 | 26 | DELETE_COPY(VideoSaver); 27 | }; 28 | } 29 | 30 | #endif // OPENPOSE_FILESTREAM_VIDEO_SAVER_HPP 31 | -------------------------------------------------------------------------------- /include/openpose/gui/enumClasses.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_GUI_ENUM_CLASSES_HPP 2 | #define OPENPOSE_GUI_ENUM_CLASSES_HPP 3 | 4 | namespace op 5 | { 6 | /** 7 | * GUI display modes. 8 | * An enum class with the different output screen options (e.g. full screen, windored or disabling the display). 9 | */ 10 | enum class GuiDisplayMode : bool 11 | { 12 | FullScreen, /**< Full screen mode. */ 13 | Windowed, /**< Windowed mode, depending on the frame output size. */ 14 | // NoDisplay, /**< Not displaying the output. */ 15 | }; 16 | } 17 | 18 | #endif // OPENPOSE_GUI_ENUM_CLASSES_HPP 19 | -------------------------------------------------------------------------------- /include/openpose/gui/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_GUI_HEADERS_HPP 2 | #define OPENPOSE_GUI_HEADERS_HPP 3 | 4 | // gui module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #endif // OPENPOSE_GUI_HEADERS_HPP 13 | -------------------------------------------------------------------------------- /include/openpose/hand/handDetectorFromTxt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_HAND_HAND_DETECTOR_FROM_TXT_HPP 2 | #define OPENPOSE_HAND_HAND_DETECTOR_FROM_TXT_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | class OP_API HandDetectorFromTxt 10 | { 11 | public: 12 | explicit HandDetectorFromTxt(const std::string& txtDirectoryPath); 13 | 14 | std::vector, 2>> detectHands(); 15 | 16 | private: 17 | const std::string mTxtDirectoryPath; 18 | const std::vector mFilePaths; 19 | long long mFrameNameCounter; 20 | 21 | DELETE_COPY(HandDetectorFromTxt); 22 | }; 23 | } 24 | 25 | #endif // OPENPOSE_HAND_HAND_DETECTOR_FROM_TXT_HPP 26 | -------------------------------------------------------------------------------- /include/openpose/hand/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_HAND_HEADERS_HPP 2 | #define OPENPOSE_HAND_HEADERS_HPP 3 | 4 | // hand module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #endif // OPENPOSE_HAND_HEADERS_HPP 19 | -------------------------------------------------------------------------------- /include/openpose/hand/renderHand.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_HAND_GPU_HAND_RENDER_HPP 2 | #define OPENPOSE_HAND_GPU_HAND_RENDER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | OP_API void renderHandKeypointsCpu(Array& frameArray, const std::array, 2>& handKeypoints, 10 | const float renderThreshold); 11 | 12 | OP_API void renderHandKeypointsGpu(float* framePtr, const Point& frameSize, const float* const handsPtr, 13 | const int numberHands, const float renderThreshold, 14 | const float alphaColorToAdd = HAND_DEFAULT_ALPHA_KEYPOINT); 15 | } 16 | 17 | #endif // OPENPOSE_HAND_GPU_HAND_RENDER_HPP 18 | -------------------------------------------------------------------------------- /include/openpose/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_HEADERS_HPP 2 | #define OPENPOSE_HEADERS_HPP 3 | 4 | // core module 5 | #include 6 | 7 | // experimental module 8 | #include 9 | 10 | // face module 11 | #include 12 | 13 | // filestream module 14 | #include 15 | 16 | // gui module 17 | #include 18 | 19 | // hand module 20 | #include 21 | 22 | // pose module 23 | #include 24 | 25 | // producer module 26 | #include 27 | 28 | // threading module 29 | #include 30 | 31 | // utilities module 32 | #include 33 | 34 | // wrapper module 35 | #include 36 | 37 | #endif // OPENPOSE_HEADERS_HPP 38 | -------------------------------------------------------------------------------- /include/openpose/pose/bodyPartConnectorBase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP 2 | #define OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | template 10 | OP_API void connectBodyPartsCpu(Array& poseKeypoints, const T* const heatMapPtr, const T* const peaksPtr, const PoseModel poseModel, const Point& heatMapSize, const int maxPeaks, 11 | const int interMinAboveThreshold, const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T scaleFactor = 1.f); 12 | 13 | #ifndef CPU_ONLY 14 | template 15 | OP_API void connectBodyPartsGpu(Array& poseKeypoints, T* posePtr, const T* const heatMapPtr, const T* const peaksPtr, const PoseModel poseModel, const Point& heatMapSize, 16 | const int maxPeaks, const int interMinAboveThreshold, const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T scaleFactor = 1.f); 17 | #endif 18 | } 19 | 20 | #endif // OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP 21 | -------------------------------------------------------------------------------- /include/openpose/pose/enumClasses.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_POSE_ENUM_CLASSES_HPP 2 | #define OPENPOSE_POSE_ENUM_CLASSES_HPP 3 | 4 | namespace op 5 | { 6 | /** 7 | * An enum class in which all the possible type of pose estimation models are included. 8 | */ 9 | enum class PoseModel : unsigned char 10 | { 11 | COCO_18 = 0, /**< COCO model, with 18+1 components (see poseParameters.hpp for details). */ 12 | MPI_15 = 1, /**< MPI model, with 15+1 components (see poseParameters.hpp for details). */ 13 | MPI_15_4 = 2, /**< Variation of the MPI model, reduced number of CNN stages to 4: faster but less accurate.*/ 14 | BODY_22 = 3, /**< Experimental. Do not use. */ 15 | Size, 16 | }; 17 | 18 | enum class PoseProperty : unsigned char 19 | { 20 | NMSThreshold = 0, 21 | ConnectInterMinAboveThreshold, 22 | ConnectInterThreshold, 23 | ConnectMinSubsetCnt, 24 | ConnectMinSubsetScore, 25 | Size, 26 | }; 27 | } 28 | 29 | #endif // OPENPOSE_POSE_ENUM_CLASSES_HPP 30 | -------------------------------------------------------------------------------- /include/openpose/pose/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_POSE_HEADERS_HPP 2 | #define OPENPOSE_POSE_HEADERS_HPP 3 | 4 | // pose module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #endif // OPENPOSE_POSE_HEADERS_HPP 17 | -------------------------------------------------------------------------------- /include/openpose/producer/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_PRODUCER_HEADERS_HPP 2 | #define OPENPOSE_PRODUCER_HEADERS_HPP 3 | 4 | // producer module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif // OPENPOSE_PRODUCER_HEADERS_HPP 15 | -------------------------------------------------------------------------------- /include/openpose/thread/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_THREAD_HEADERS_HPP 2 | #define OPENPOSE_THREAD_HEADERS_HPP 3 | 4 | // thread module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #endif // OPENPOSE_THREAD_HEADERS_HPP 23 | -------------------------------------------------------------------------------- /include/openpose/thread/workerConsumer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_THREAD_WORKER_CONSUMER_HPP 2 | #define OPENPOSE_THREAD_WORKER_CONSUMER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | template 10 | class WorkerConsumer : public Worker 11 | { 12 | public: 13 | virtual ~WorkerConsumer(); 14 | 15 | inline void work(TDatums& tDatums) 16 | { 17 | workConsumer(tDatums); 18 | } 19 | 20 | protected: 21 | virtual void workConsumer(const TDatums& tDatums) = 0; 22 | }; 23 | } 24 | 25 | 26 | 27 | 28 | 29 | // Implementation 30 | namespace op 31 | { 32 | template 33 | WorkerConsumer::~WorkerConsumer() 34 | { 35 | } 36 | 37 | COMPILE_TEMPLATE_DATUM(WorkerConsumer); 38 | } 39 | 40 | #endif // OPENPOSE_THREAD_WORKER_CONSUMER_HPP 41 | -------------------------------------------------------------------------------- /include/openpose/thread/workerProducer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_THREAD_WORKER_PRODUCER_HPP 2 | #define OPENPOSE_THREAD_WORKER_PRODUCER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace op 8 | { 9 | template 10 | class WorkerProducer : public Worker 11 | { 12 | public: 13 | virtual ~WorkerProducer(); 14 | 15 | inline void work(TDatums& tDatums) 16 | { 17 | tDatums = std::move(workProducer()); 18 | } 19 | 20 | protected: 21 | virtual TDatums workProducer() = 0; 22 | }; 23 | } 24 | 25 | 26 | 27 | 28 | 29 | // Implementation 30 | namespace op 31 | { 32 | template 33 | WorkerProducer::~WorkerProducer() 34 | { 35 | } 36 | 37 | COMPILE_TEMPLATE_DATUM(WorkerProducer); 38 | } 39 | 40 | #endif // OPENPOSE_THREAD_WORKER_PRODUCER_HPP 41 | -------------------------------------------------------------------------------- /include/openpose/utilities/cuda.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_UTILITIES_CUDA_HPP 2 | #define OPENPOSE_UTILITIES_CUDA_HPP 3 | 4 | #ifndef CPU_ONLY 5 | #include 6 | #include 7 | #endif 8 | 9 | #include // std::pair 10 | #include 11 | 12 | namespace op 13 | { 14 | const auto CUDA_NUM_THREADS = 512u; 15 | 16 | OP_API void cudaCheck(const int line = -1, const std::string& function = "", const std::string& file = ""); 17 | 18 | OP_API int getGpuNumber(); 19 | 20 | inline unsigned int getNumberCudaBlocks(const unsigned int totalRequired, const unsigned int numberCudaThreads = CUDA_NUM_THREADS) 21 | { 22 | return (totalRequired + numberCudaThreads - 1) / numberCudaThreads; 23 | } 24 | 25 | #ifndef CPU_ONLY 26 | OP_API dim3 getNumberCudaBlocks(const Point& frameSize, const dim3 numberCudaThreads = dim3{ CUDA_NUM_THREADS, CUDA_NUM_THREADS, 1 }); 27 | 28 | OP_API std::pair getNumberCudaThreadsAndBlocks(const Point& frameSize); 29 | #endif 30 | } 31 | 32 | #endif // OPENPOSE_UTILITIES_CUDA_HPP 33 | -------------------------------------------------------------------------------- /include/openpose/utilities/enumClasses.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_UTILITIES_ENUM_CLASSES_HPP 2 | #define OPENPOSE_UTILITIES_ENUM_CLASSES_HPP 3 | 4 | namespace op 5 | { 6 | enum class ErrorMode : unsigned char 7 | { 8 | StdRuntimeError, 9 | FileLogging, 10 | StdCerr, 11 | All, 12 | }; 13 | 14 | enum class LogMode : unsigned char 15 | { 16 | FileLogging, 17 | StdCout, 18 | All, 19 | }; 20 | 21 | enum class Priority : unsigned char 22 | { 23 | None = 0, 24 | Low = 1, 25 | Normal = 2, 26 | High = 3, 27 | Max = 4, 28 | NoOutput = 255, 29 | }; 30 | } 31 | 32 | #endif // OPENPOSE_UTILITIES_ENUM_CLASSES_HPP 33 | -------------------------------------------------------------------------------- /include/openpose/utilities/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_UTILITIES_HEADERS_HPP 2 | #define OPENPOSE_UTILITIES_HEADERS_HPP 3 | 4 | // utilities module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #endif // OPENPOSE_UTILITIES_HEADERS_HPP 19 | -------------------------------------------------------------------------------- /include/openpose/utilities/string.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_UTILITIES_STRING_HPP 2 | #define OPENPOSE_UTILITIES_STRING_HPP 3 | 4 | #include 5 | 6 | namespace op 7 | { 8 | /** 9 | * This template function turns an integer number into a fixed-length std::string. 10 | * @param number T integer corresponding to the integer to be formatted. 11 | * @param stringLength unsigned long long indicating the final length. If 0, the 12 | * final length is the original number length. 13 | * @return std::string with the formatted value. 14 | */ 15 | template 16 | OP_API std::string toFixedLengthString(const T number, const unsigned long long stringLength = 0); 17 | 18 | OP_API std::vector splitString(const std::string& stringToSplit, const std::string& delimiter); 19 | 20 | OP_API std::string toLower(const std::string& string); 21 | 22 | OP_API std::string toUpper(const std::string& string); 23 | } 24 | 25 | #endif // OPENPOSE_UTILITIES_STRING_HPP 26 | -------------------------------------------------------------------------------- /include/openpose/wrapper/headers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPENPOSE_WRAPPER_HEADERS_HPP 2 | #define OPENPOSE_WRAPPER_HEADERS_HPP 3 | 4 | // wrapper module 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #endif // OPENPOSE_WRAPPER_HEADERS_HPP 13 | -------------------------------------------------------------------------------- /src/openpose/core/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WCvMatToOpInput); 6 | DEFINE_TEMPLATE_DATUM(WCvMatToOpOutput); 7 | DEFINE_TEMPLATE_DATUM(WKeypointScaler); 8 | DEFINE_TEMPLATE_DATUM(WOpOutputToCvMat); 9 | } 10 | -------------------------------------------------------------------------------- /src/openpose/core/opOutputToCvMat.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace op 5 | { 6 | OpOutputToCvMat::OpOutputToCvMat(const Point& outputResolution) : 7 | mOutputResolution{outputResolution} 8 | { 9 | } 10 | 11 | cv::Mat OpOutputToCvMat::formatToCvMat(const Array& outputData) const 12 | { 13 | try 14 | { 15 | // Security checks 16 | if (outputData.empty()) 17 | error("Wrong input element (empty outputData).", __LINE__, __FUNCTION__, __FILE__); 18 | 19 | cv::Mat cvMat; 20 | floatPtrToUCharCvMat(cvMat, outputData.getConstPtr(), mOutputResolution, 3); 21 | 22 | return cvMat; 23 | } 24 | catch (const std::exception& e) 25 | { 26 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); 27 | return cv::Mat{}; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/openpose/face/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WFaceDetector); 6 | DEFINE_TEMPLATE_DATUM(WFaceExtractor); 7 | DEFINE_TEMPLATE_DATUM(WFaceRenderer); 8 | } 9 | -------------------------------------------------------------------------------- /src/openpose/face/renderFace.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace op 7 | { 8 | void renderFaceKeypointsCpu(Array& frameArray, const Array& faceKeypoints, const float renderThreshold) 9 | { 10 | try 11 | { 12 | if (!frameArray.empty()) 13 | { 14 | // Parameters 15 | const auto thicknessCircleRatio = 1.f/75.f; 16 | const auto thicknessLineRatioWRTCircle = 0.334f; 17 | const auto& pairs = FACE_PAIRS_RENDER; 18 | 19 | // Render keypoints 20 | renderKeypointsCpu(frameArray, faceKeypoints, pairs, FACE_COLORS_RENDER, thicknessCircleRatio, thicknessLineRatioWRTCircle, renderThreshold); 21 | } 22 | } 23 | catch (const std::exception& e) 24 | { 25 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/openpose/filestream/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WCocoJsonSaver); 6 | DEFINE_TEMPLATE_DATUM(WFaceSaver); 7 | DEFINE_TEMPLATE_DATUM(WHandSaver); 8 | DEFINE_TEMPLATE_DATUM(WHeatMapSaver); 9 | DEFINE_TEMPLATE_DATUM(WImageSaver); 10 | DEFINE_TEMPLATE_DATUM(WKeypointJsonSaver); 11 | DEFINE_TEMPLATE_DATUM(WPoseSaver); 12 | DEFINE_TEMPLATE_DATUM(WVideoSaver); 13 | } 14 | -------------------------------------------------------------------------------- /src/openpose/filestream/keypointJsonSaver.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace op 5 | { 6 | KeypointJsonSaver::KeypointJsonSaver(const std::string& directoryPath) : 7 | FileSaver{directoryPath} 8 | { 9 | } 10 | 11 | void KeypointJsonSaver::save(const std::vector, std::string>>& keypointVector, 12 | const std::string& fileName, const bool humanReadable) const 13 | { 14 | try 15 | { 16 | // Record json 17 | const auto finalFileName = getNextFileName(fileName) + ".json"; 18 | saveKeypointsJson(keypointVector, finalFileName, humanReadable); 19 | } 20 | catch (const std::exception& e) 21 | { 22 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/openpose/gui/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WGui); 6 | DEFINE_TEMPLATE_DATUM(WGuiInfoAdder); 7 | } 8 | -------------------------------------------------------------------------------- /src/openpose/hand/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WHandDetector); 6 | DEFINE_TEMPLATE_DATUM(WHandDetectorFromTxt); 7 | DEFINE_TEMPLATE_DATUM(WHandDetectorTracking); 8 | DEFINE_TEMPLATE_DATUM(WHandDetectorUpdate); 9 | DEFINE_TEMPLATE_DATUM(WHandExtractor); 10 | DEFINE_TEMPLATE_DATUM(WHandRenderer); 11 | } 12 | -------------------------------------------------------------------------------- /src/openpose/pose/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(WPoseExtractor); 6 | DEFINE_TEMPLATE_DATUM(WPoseRenderer); 7 | } 8 | -------------------------------------------------------------------------------- /src/openpose/producer/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | template class OP_API DatumProducer; 6 | template class OP_API WDatumProducer; 7 | } 8 | -------------------------------------------------------------------------------- /src/openpose/producer/videoReader.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace op 5 | { 6 | VideoReader::VideoReader(const std::string & videoPath) : 7 | VideoCaptureReader{videoPath}, 8 | mPathName{getFileNameNoExtension(videoPath)} 9 | { 10 | } 11 | 12 | std::string VideoReader::getFrameName() 13 | { 14 | try 15 | { 16 | return mPathName + "_" + VideoCaptureReader::getFrameName(); 17 | } 18 | catch (const std::exception& e) 19 | { 20 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); 21 | return ""; 22 | } 23 | } 24 | 25 | cv::Mat VideoReader::getRawFrame() 26 | { 27 | try 28 | { 29 | return VideoCaptureReader::getRawFrame(); 30 | } 31 | catch (const std::exception& e) 32 | { 33 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); 34 | return cv::Mat{}; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/openpose/thread/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | DEFINE_TEMPLATE_DATUM(PriorityQueue); 6 | DEFINE_TEMPLATE_DATUM(Queue); 7 | template class OP_API QueueBase>; 8 | template class OP_API QueueBase, std::greater>>; 9 | DEFINE_TEMPLATE_DATUM(SubThread); 10 | DEFINE_TEMPLATE_DATUM(SubThreadNoQueue); 11 | DEFINE_TEMPLATE_DATUM(SubThreadQueueIn); 12 | DEFINE_TEMPLATE_DATUM(SubThreadQueueInOut); 13 | DEFINE_TEMPLATE_DATUM(SubThreadQueueOut); 14 | DEFINE_TEMPLATE_DATUM(Thread); 15 | DEFINE_TEMPLATE_DATUM(ThreadManager); 16 | DEFINE_TEMPLATE_DATUM(Worker); 17 | DEFINE_TEMPLATE_DATUM(WorkerConsumer); 18 | DEFINE_TEMPLATE_DATUM(WorkerProducer); 19 | DEFINE_TEMPLATE_DATUM(WIdGenerator); 20 | DEFINE_TEMPLATE_DATUM(WQueueOrderer); 21 | } 22 | -------------------------------------------------------------------------------- /src/openpose/wrapper/defineTemplates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | template class OP_API Wrapper; 6 | } 7 | -------------------------------------------------------------------------------- /src/openpose/wrapper/wrapperStructFace.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | WrapperStructFace::WrapperStructFace(const bool enable_, const Point& netInputSize_, const RenderMode renderMode_, 6 | const float alphaKeypoint_, const float alphaHeatMap_, 7 | const float renderThreshold_) : 8 | enable{enable_}, 9 | netInputSize{netInputSize_}, 10 | renderMode{renderMode_}, 11 | alphaKeypoint{alphaKeypoint_}, 12 | alphaHeatMap{alphaHeatMap_}, 13 | renderThreshold{renderThreshold_} 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/openpose/wrapper/wrapperStructHand.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | WrapperStructHand::WrapperStructHand(const bool enable_, const Point& netInputSize_, const int scalesNumber_, 6 | const float scaleRange_, const bool tracking_, const RenderMode renderMode_, 7 | const float alphaKeypoint_, const float alphaHeatMap_, 8 | const float renderThreshold_) : 9 | enable{enable_}, 10 | netInputSize{netInputSize_}, 11 | scalesNumber{scalesNumber_}, 12 | scaleRange{scaleRange_}, 13 | tracking{tracking_}, 14 | renderMode{renderMode_}, 15 | alphaKeypoint{alphaKeypoint_}, 16 | alphaHeatMap{alphaHeatMap_}, 17 | renderThreshold{renderThreshold_} 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/openpose/wrapper/wrapperStructInput.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace op 4 | { 5 | WrapperStructInput::WrapperStructInput(const std::shared_ptr producerSharedPtr_, const unsigned long long frameFirst_, const unsigned long long frameLast_, 6 | const bool realTimeProcessing_, const bool frameFlip_, const int frameRotate_, const bool framesRepeat_) : 7 | producerSharedPtr{producerSharedPtr_}, 8 | frameFirst{frameFirst_}, 9 | frameLast{frameLast_}, 10 | realTimeProcessing{realTimeProcessing_}, 11 | frameFlip{frameFlip_}, 12 | frameRotate{frameRotate_}, 13 | framesRepeat{framesRepeat_} 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /windows/OpenPose/OpenPose.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;3rdparty\windows\freeglut\bin;3rdparty\windows\spinnaker\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | ..\.. 10 | WindowsLocalDebugger 11 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;3rdparty\windows\freeglut\bin;3rdparty\windows\spinnaker\bin 12 | 13 | -------------------------------------------------------------------------------- /windows/OpenPoseDemo/OpenPoseDemo.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/OpenPoseDemo/OpenPoseDemo.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialPose/1_extract_from_image.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialPose/1_extract_from_image.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialThread/1_openpose_read_and_display.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialThread/1_openpose_read_and_display.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialThread/2_user_processing_function.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialThread/2_user_processing_function.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialThread/3_user_input_processing_and_output.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialThread/3_user_input_processing_and_output.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialWrapper/1_user_asynchronous.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialWrapper/1_user_asynchronous.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | -------------------------------------------------------------------------------- /windows/TutorialWrapper/2_user_synchronous.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /windows/TutorialWrapper/2_user_synchronous.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 5 | WindowsLocalDebugger 6 | ..\.. 7 | 8 | 9 | PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin 10 | WindowsLocalDebugger 11 | ..\.. 12 | 13 | --------------------------------------------------------------------------------