// 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 categories using the deep learning tools from the dlib C++ Library. We will use the pretrained ResNet34 model available on the dlib website. The ResNet34 architecture is from the paper Deep Residual Learning for Image Recognition by He, Zhang, Ren, and Sun. The model file that comes with dlib was trained using the dnn_imagenet_train_ex.cpp program on a Titan X for about 2 weeks. This pretrained model has a top5 error of 7.572% on the 2012 imagenet validation dataset. For an introduction to dlib's DNN module read the dnn_introduction_ex.cpp and dnn_introduction2_ex.cpp example programs. Finally, 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; // ---------------------------------------------------------------------------------------- // This block of statements defines the resnet-34 network template