diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 02048e328..b33be7df4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -124,6 +124,7 @@ jobs: - name: Build tests working-directory: ${{ github.workspace }}/test run: | + echo `pwd` cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -G Ninja cmake --build . diff --git a/dlib/test/CMakeLists.txt b/dlib/test/CMakeLists.txt index 8d05fdce5..4536b7cb9 100644 --- a/dlib/test/CMakeLists.txt +++ b/dlib/test/CMakeLists.txt @@ -17,147 +17,147 @@ add_subdirectory(.. dlib_build) # This variable contains a list of all the tests we are building # into the regression test suite. set (tests - example.cpp - active_learning.cpp - any.cpp - any_function.cpp - array2d.cpp - array.cpp - assignment_learning.cpp - base64.cpp - bayes_nets.cpp - bigint.cpp - binary_search_tree_kernel_1a.cpp - binary_search_tree_kernel_2a.cpp - binary_search_tree_mm1.cpp - binary_search_tree_mm2.cpp - bridge.cpp - bsp.cpp - byte_orderer.cpp - cca.cpp - clustering.cpp - cmd_line_parser.cpp - cmd_line_parser_wchar_t.cpp - compress_stream.cpp - conditioning_class_c.cpp - conditioning_class.cpp - config_reader.cpp - correlation_tracker.cpp - crc32.cpp - create_iris_datafile.cpp - data_io.cpp - directed_graph.cpp - discriminant_pca.cpp - disjoint_subsets.cpp - disjoint_subsets_sized.cpp - ekm_and_lisf.cpp - empirical_kernel_map.cpp - entropy_coder.cpp - entropy_encoder_model.cpp - example_args.cpp - face.cpp - fft.cpp - fhog.cpp - filtering.cpp - find_max_factor_graph_nmplp.cpp - find_max_factor_graph_viterbi.cpp - geometry.cpp - graph.cpp - graph_cuts.cpp - graph_labeler.cpp - hash.cpp - hash_map.cpp - hash_set.cpp - hash_table.cpp - hog_image.cpp - image.cpp - iosockstream.cpp - is_same_object.cpp - isotonic_regression.cpp - kcentroid.cpp - kernel_matrix.cpp - kmeans.cpp - learning_to_track.cpp - least_squares.cpp - linear_manifold_regularizer.cpp - lspi.cpp - lz77_buffer.cpp - map.cpp - matrix2.cpp - matrix3.cpp - matrix4.cpp - matrix_chol.cpp - matrix.cpp - matrix_eig.cpp - matrix_lu.cpp - matrix_qr.cpp - max_cost_assignment.cpp - max_sum_submatrix.cpp - md5.cpp - member_function_pointer.cpp - metaprogramming.cpp - mpc.cpp - multithreaded_object.cpp - numerical_integration.cpp - object_detector.cpp - oca.cpp - one_vs_all_trainer.cpp - one_vs_one_trainer.cpp - optimization.cpp - optimization_test_functions.cpp - global_optimization.cpp - opt_qp_solver.cpp - parallel_for.cpp - parse.cpp - pipe.cpp - pixel.cpp - probabilistic.cpp - pyramid_down.cpp - queue.cpp - rand.cpp - ranking.cpp - read_write_mutex.cpp - reference_counter.cpp - rls.cpp - random_forest.cpp - sammon.cpp - scan_image.cpp - sequence.cpp - sequence_labeler.cpp - sequence_segmenter.cpp - serialize.cpp - set.cpp - sldf.cpp - sliding_buffer.cpp - sockets2.cpp - sockets.cpp - sockstreambuf.cpp - sparse_vector.cpp - stack.cpp - static_map.cpp - static_set.cpp - statistics.cpp - std_vector_c.cpp - string.cpp - svm_c_linear.cpp - svm_c_linear_dcd.cpp - svm.cpp - svm_multiclass_linear.cpp - svm_struct.cpp - svr_linear_trainer.cpp - symmetric_matrix_cache.cpp - thread_pool.cpp - threads.cpp - timer.cpp - tokenizer.cpp - trust_region.cpp - tuple.cpp - type_safe_union.cpp - vectorstream.cpp + # example.cpp + # active_learning.cpp + # any.cpp + # any_function.cpp + # array2d.cpp + # array.cpp + # assignment_learning.cpp + # base64.cpp + # bayes_nets.cpp + # bigint.cpp + # binary_search_tree_kernel_1a.cpp + # binary_search_tree_kernel_2a.cpp + # binary_search_tree_mm1.cpp + # binary_search_tree_mm2.cpp + # bridge.cpp + # bsp.cpp + # byte_orderer.cpp + # cca.cpp + # clustering.cpp + # cmd_line_parser.cpp + # cmd_line_parser_wchar_t.cpp + # compress_stream.cpp + # conditioning_class_c.cpp + # conditioning_class.cpp + # config_reader.cpp + # correlation_tracker.cpp + # crc32.cpp + # create_iris_datafile.cpp + # data_io.cpp + # directed_graph.cpp + # discriminant_pca.cpp + # disjoint_subsets.cpp + # disjoint_subsets_sized.cpp + # ekm_and_lisf.cpp + # empirical_kernel_map.cpp + # entropy_coder.cpp + # entropy_encoder_model.cpp + # example_args.cpp + # face.cpp + # fft.cpp + # fhog.cpp + # filtering.cpp + # find_max_factor_graph_nmplp.cpp + # find_max_factor_graph_viterbi.cpp + # geometry.cpp + # graph.cpp + # graph_cuts.cpp + # graph_labeler.cpp + # hash.cpp + # hash_map.cpp + # hash_set.cpp + # hash_table.cpp + # hog_image.cpp + # image.cpp + # iosockstream.cpp + # is_same_object.cpp + # isotonic_regression.cpp + # kcentroid.cpp + # kernel_matrix.cpp + # kmeans.cpp + # learning_to_track.cpp + # least_squares.cpp + # linear_manifold_regularizer.cpp + # lspi.cpp + # lz77_buffer.cpp + # map.cpp + # matrix2.cpp + # matrix3.cpp + # matrix4.cpp + # matrix_chol.cpp + # matrix.cpp + # matrix_eig.cpp + # matrix_lu.cpp + # matrix_qr.cpp + # max_cost_assignment.cpp + # max_sum_submatrix.cpp + # md5.cpp + # member_function_pointer.cpp + # metaprogramming.cpp + # mpc.cpp + # multithreaded_object.cpp + # numerical_integration.cpp + # object_detector.cpp + # oca.cpp + # one_vs_all_trainer.cpp + # one_vs_one_trainer.cpp + # optimization.cpp + # optimization_test_functions.cpp + # global_optimization.cpp + # opt_qp_solver.cpp + # parallel_for.cpp + # parse.cpp + # pipe.cpp + # pixel.cpp + # probabilistic.cpp + # pyramid_down.cpp + # queue.cpp + # rand.cpp + # ranking.cpp + # read_write_mutex.cpp + # reference_counter.cpp + # rls.cpp + # random_forest.cpp + # sammon.cpp + # scan_image.cpp + # sequence.cpp + # sequence_labeler.cpp + # sequence_segmenter.cpp + # serialize.cpp + # set.cpp + # sldf.cpp + # sliding_buffer.cpp + # sockets2.cpp + # sockets.cpp + # sockstreambuf.cpp + # sparse_vector.cpp + # stack.cpp + # static_map.cpp + # static_set.cpp + # statistics.cpp + # std_vector_c.cpp + # string.cpp + # svm_c_linear.cpp + # svm_c_linear_dcd.cpp + # svm.cpp + # svm_multiclass_linear.cpp + # svm_struct.cpp + # svr_linear_trainer.cpp + # symmetric_matrix_cache.cpp + # thread_pool.cpp + # threads.cpp + # timer.cpp + # tokenizer.cpp + # trust_region.cpp + # tuple.cpp + # type_safe_union.cpp + # vectorstream.cpp dnn.cpp - cublas.cpp - find_optimal_parameters.cpp - elastic_net.cpp + # cublas.cpp + # find_optimal_parameters.cpp + # elastic_net.cpp ) @@ -170,7 +170,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) add_definitions("-W -Wall") # I don't care about unused testing functions though. I like to keep them # around. Don't warn about it. - add_definitions("-Wno-unused-function") + add_definitions("-Wno-unused-function -Wno-deprecated-copy -fdiagnostics-color=always") endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 893f8a3c7..8c538beee 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -36,6 +36,7 @@ cmake_minimum_required(VERSION 2.8.12) # Every project needs a name. We call this the "examples" project. project(examples) +add_compile_options (-fdiagnostics-color=always) # Tell cmake we will need dlib. This command will pull in dlib and compile it # into your project. Note that you don't need to compile or install dlib. All @@ -60,10 +61,10 @@ add_subdirectory(../dlib dlib_build) # are going to compile one of the dlib example programs which has only one .cpp # file, assignment_learning_ex.cpp. If your program consisted of multiple .cpp # files you would simply list them here in the add_executable() statement. -add_executable(assignment_learning_ex assignment_learning_ex.cpp) +# add_executable(assignment_learning_ex assignment_learning_ex.cpp) # Finally, you need to tell CMake that this program, assignment_learning_ex, # depends on dlib. You do that with this statement: -target_link_libraries(assignment_learning_ex dlib::dlib) +# target_link_libraries(assignment_learning_ex dlib::dlib) @@ -134,132 +135,135 @@ endmacro() # like this: # cmake .. -G "Visual Studio 14 2015 Win64" -T host=x64 if (NOT USING_OLD_VISUAL_STUDIO_COMPILER) - add_example(dnn_metric_learning_ex) - add_gui_example(dnn_face_recognition_ex) + # add_example(dnn_metric_learning_ex) + # add_gui_example(dnn_face_recognition_ex) add_example(dnn_introduction_ex) - add_example(dnn_introduction2_ex) - add_example(dnn_introduction3_ex) - add_example(dnn_inception_ex) - add_gui_example(dnn_mmod_ex) - add_gui_example(dnn_mmod_face_detection_ex) - add_gui_example(random_cropper_ex) - add_gui_example(dnn_mmod_dog_hipsterizer) + # add_example(dnn_introduction2_ex) + # add_example(dnn_introduction3_ex) + # add_example(dnn_inception_ex) + # add_gui_example(dnn_mmod_ex) + # add_gui_example(dnn_mmod_face_detection_ex) + # add_gui_example(random_cropper_ex) + # add_gui_example(dnn_mmod_dog_hipsterizer) add_gui_example(dnn_imagenet_ex) - add_gui_example(dnn_mmod_find_cars_ex) - add_gui_example(dnn_mmod_find_cars2_ex) - add_example(dnn_mmod_train_find_cars_ex) - add_gui_example(dnn_semantic_segmentation_ex) - add_gui_example(dnn_instance_segmentation_ex) - add_example(dnn_imagenet_train_ex) - add_example(dnn_semantic_segmentation_train_ex) - add_example(dnn_instance_segmentation_train_ex) - add_example(dnn_metric_learning_on_images_ex) - add_gui_example(dnn_dcgan_train_ex) + # add_gui_example(dnn_mmod_find_cars_ex) + # add_gui_example(dnn_mmod_find_cars2_ex) + # add_example(dnn_mmod_train_find_cars_ex) + # add_gui_example(dnn_semantic_segmentation_ex) + # add_gui_example(dnn_instance_segmentation_ex) + # add_example(dnn_imagenet_train_ex) + # add_example(dnn_semantic_segmentation_train_ex) + # add_example(dnn_instance_segmentation_train_ex) + # add_example(dnn_metric_learning_on_images_ex) + # add_gui_example(dnn_dcgan_train_ex) + # add_gui_example(dnn_neural_style_transfer_ex) endif() -if (DLIB_NO_GUI_SUPPORT) - message("No GUI support, so we won't build the webcam_face_pose_ex example.") -else() - find_package(OpenCV QUIET) - if (OpenCV_FOUND) - include_directories(${OpenCV_INCLUDE_DIRS}) +# if (DLIB_NO_GUI_SUPPORT) +# message("No GUI support, so we won't build the webcam_face_pose_ex example.") +# else() +# find_package(OpenCV QUIET) +# if (OpenCV_FOUND) +# include_directories(${OpenCV_INCLUDE_DIRS}) - add_executable(webcam_face_pose_ex webcam_face_pose_ex.cpp) - target_link_libraries(webcam_face_pose_ex dlib::dlib ${OpenCV_LIBS} ) - else() - message("OpenCV not found, so we won't build the webcam_face_pose_ex example.") - endif() -endif() +# add_executable(webcam_face_pose_ex webcam_face_pose_ex.cpp) +# target_link_libraries(webcam_face_pose_ex dlib::dlib ${OpenCV_LIBS} ) +# else() +# message("OpenCV not found, so we won't build the webcam_face_pose_ex example.") +# endif() +# endif() -#here we apply our macros -add_gui_example(3d_point_cloud_ex) -add_example(bayes_net_ex) -add_example(bayes_net_from_disk_ex) -add_gui_example(bayes_net_gui_ex) -add_example(bridge_ex) -add_example(bsp_ex) -add_example(compress_stream_ex) -add_example(config_reader_ex) -add_example(custom_trainer_ex) -add_example(dir_nav_ex) -add_example(empirical_kernel_map_ex) -add_gui_example(face_detection_ex) -add_gui_example(face_landmark_detection_ex) -add_gui_example(fhog_ex) -add_gui_example(fhog_object_detector_ex) -add_example(file_to_code_ex) -add_example(graph_labeling_ex) +# #here we apply our macros +# add_gui_example(3d_point_cloud_ex) +# add_example(bayes_net_ex) +# add_example(bayes_net_from_disk_ex) +# add_gui_example(bayes_net_gui_ex) +# add_example(bridge_ex) +# add_example(bsp_ex) +# add_example(compress_stream_ex) +# add_example(config_reader_ex) +# add_example(custom_trainer_ex) +# add_example(dir_nav_ex) +# add_example(empirical_kernel_map_ex) +# add_gui_example(face_detection_ex) +# add_gui_example(face_landmark_detection_ex) +# add_gui_example(fhog_ex) +# add_gui_example(fhog_object_detector_ex) +# add_example(file_to_code_ex) +# add_example(graph_labeling_ex) add_gui_example(gui_api_ex) -add_gui_example(hough_transform_ex) -add_gui_example(image_ex) -add_example(integrate_function_adapt_simp_ex) -add_example(iosockstream_ex) -add_example(kcentroid_ex) -add_example(kkmeans_ex) -add_example(krls_ex) -add_example(krls_filter_ex) -add_example(krr_classification_ex) -add_example(krr_regression_ex) -add_example(learning_to_track_ex) -add_example(least_squares_ex) -add_example(linear_manifold_regularizer_ex) -add_example(logger_custom_output_ex) -add_example(logger_ex) -add_example(logger_ex_2) -add_example(matrix_ex) -add_example(matrix_expressions_ex) -add_example(max_cost_assignment_ex) -add_example(member_function_pointer_ex) -add_example(mlp_ex) -add_example(model_selection_ex) -add_gui_example(mpc_ex) -add_example(multiclass_classification_ex) -add_example(multithreaded_object_ex) -add_gui_example(object_detector_advanced_ex) -add_gui_example(object_detector_ex) -add_gui_example(one_class_classifiers_ex) -add_example(optimization_ex) -add_example(parallel_for_ex) -add_example(pipe_ex) -add_example(pipe_ex_2) -add_example(quantum_computing_ex) -add_example(queue_ex) -add_example(rank_features_ex) -add_example(running_stats_ex) -add_example(rvm_ex) -add_example(rvm_regression_ex) -add_example(sequence_labeler_ex) -add_example(sequence_segmenter_ex) -add_example(server_http_ex) -add_example(server_iostream_ex) -add_example(sockets_ex) -add_example(sockstreambuf_ex) -add_example(std_allocator_ex) -add_gui_example(surf_ex) -add_example(svm_c_ex) -add_example(svm_ex) -add_example(svm_pegasos_ex) -add_example(svm_rank_ex) -add_example(svm_sparse_ex) -add_example(svm_struct_ex) -add_example(svr_ex) -add_example(thread_function_ex) -add_example(thread_pool_ex) -add_example(threaded_object_ex) -add_example(threads_ex) -add_example(timer_ex) -add_gui_example(train_object_detector) -add_example(train_shape_predictor_ex) -add_example(using_custom_kernels_ex) -add_gui_example(video_tracking_ex) -add_example(xml_parser_ex) +# add_gui_example(hough_transform_ex) +# add_gui_example(image_ex) +# add_example(integrate_function_adapt_simp_ex) +# add_example(iosockstream_ex) +# add_example(kcentroid_ex) +# add_example(kkmeans_ex) +# add_example(krls_ex) +# add_example(krls_filter_ex) +# add_example(krr_classification_ex) +# add_example(krr_regression_ex) +# add_example(learning_to_track_ex) +# add_example(least_squares_ex) +# add_example(linear_manifold_regularizer_ex) +# add_example(logger_custom_output_ex) +# add_example(logger_ex) +# add_example(logger_ex_2) +# add_example(matrix_ex) +# add_example(matrix_expressions_ex) +# add_example(max_cost_assignment_ex) +# add_example(member_function_pointer_ex) +# add_example(mlp_ex) +# add_example(model_selection_ex) +# add_gui_example(mpc_ex) +# add_example(multiclass_classification_ex) +# add_example(multithreaded_object_ex) +# add_gui_example(object_detector_advanced_ex) +# add_gui_example(object_detector_ex) +# add_gui_example(one_class_classifiers_ex) +# add_example(optimization_ex) +# add_example(parallel_for_ex) +# add_example(pipe_ex) +# add_example(pipe_ex_2) +# add_example(quantum_computing_ex) +# add_example(queue_ex) +# add_example(rank_features_ex) +# add_example(running_stats_ex) +# add_example(rvm_ex) +# add_example(rvm_regression_ex) +# add_example(sequence_labeler_ex) +# add_example(sequence_segmenter_ex) +# add_example(server_http_ex) +# add_example(server_iostream_ex) +# add_example(sockets_ex) +# add_example(sockstreambuf_ex) +# add_example(std_allocator_ex) +# add_gui_example(surf_ex) +# add_example(svm_c_ex) +# add_example(svm_ex) +# add_example(svm_pegasos_ex) +# add_example(svm_rank_ex) +# add_example(svm_sparse_ex) +# add_example(svm_struct_ex) +# add_example(svr_ex) +# add_example(thread_function_ex) +# add_example(thread_pool_ex) +# add_example(threaded_object_ex) +# add_example(threads_ex) +# add_example(timer_ex) +# add_gui_example(train_object_detector) +# add_example(train_shape_predictor_ex) +# add_example(using_custom_kernels_ex) +# add_gui_example(video_tracking_ex) +# add_example(xml_parser_ex) +# add_example(dnn_graph_visitor_ex) +add_example(playground) -if (DLIB_LINK_WITH_SQLITE3) - add_example(sqlite_ex) -endif() +# if (DLIB_LINK_WITH_SQLITE3) +# add_example(sqlite_ex) +# endif() diff --git a/examples/dnn_imagenet_ex.cpp b/examples/dnn_imagenet_ex.cpp index d1fa82823..bc87d10bb 100644 --- a/examples/dnn_imagenet_ex.cpp +++ b/examples/dnn_imagenet_ex.cpp @@ -13,7 +13,7 @@ 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 @@ -30,7 +30,7 @@ using namespace std; using namespace dlib; - + // ---------------------------------------------------------------------------------------- // This block of statements defines the resnet-34 network @@ -41,7 +41,7 @@ using residual = add_prev1>>; template