diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 153fe6b0e..7500b5dc6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -34,6 +34,7 @@ if (COMPILER_CAN_DO_CPP_11) add_example(dnn_mnist_ex) add_example(dnn_mnist_advanced_ex) add_example(dnn_inception_ex) + add_example(dnn_imagenet_ex) endif() #here we apply our macros diff --git a/examples/dnn_imagenet_ex.cpp b/examples/dnn_imagenet_ex.cpp new file mode 100644 index 000000000..2c8d98bb6 --- /dev/null +++ b/examples/dnn_imagenet_ex.cpp @@ -0,0 +1,141 @@ +// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt +/* + This example shows how to classify an image into one of the 1000 imagenet clategories + using the deep learning tools from the dlib C++ Library. We will use the pretrained + ResNet34 model available on the dlib website. + + + These tools will use CUDA and cuDNN to drastically accelerate network + training and testing. CMake should automatically find them if they are + installed and configure things appropriately. If not, the program will + still run but will be much slower to execute. +*/ + + + +#include +#include +#include +#include +#include + +using namespace std; +using namespace dlib; + +// ---------------------------------------------------------------------------------------- + + +template