debug test path

This commit is contained in:
Adrià Arrufat 2021-01-19 23:51:20 +09:00
parent e532993364
commit 6d5b4e7a1f
6 changed files with 332 additions and 316 deletions

View File

@ -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 .

View File

@ -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()

View File

@ -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()

View File

@ -150,17 +150,24 @@ int main(int argc, char** argv) try
// p(i) == the probability the image contains object of class i.
matrix<float,1,1000> p = sum_rows(mat(snet(images.begin(), images.end())))/num_crops;
win.set_image(img);
// win.set_image(img);
bool keep = false;
// Print the 5 most probable labels
for (int k = 0; k < 5; ++k)
{
unsigned long predicted_label = index_of_max(p);
cout << p(predicted_label) << ": " << labels[predicted_label] << endl;
// cout << p(predicted_label) << ": " << labels[predicted_label] << endl;
p(predicted_label) = 0;
if (labels[predicted_label] == "racket" or labels[predicted_label] == "tennis_ball")
keep = true;
}
cout << "Hit enter to process the next image";
cin.get();
if (not keep)
{
std::remove(argv[i]);
cout << "removing " << argv[i] << '\n';
}
// cout << "Hit enter to process the next image";
// cin.get();
}
}

View File

@ -70,10 +70,10 @@ int main(int argc, char** argv) try
// is largest then the predicted digit is 9.
using net_type = loss_multiclass_log<
fc<10,
relu<fc<84,
relu<fc<120,
max_pool<2,2,2,2,relu<con<16,5,5,1,1,
max_pool<2,2,2,2,relu<con<6,5,5,1,1,
elu<fc<84,
elu<fc<120,
max_pool<2,2,2,2,elu<con<16,5,5,1,1,
max_pool<2,2,2,2,elu<con<6,5,5,1,1,
input<matrix<unsigned char>>
>>>>>>>>>>>>;
// This net_type defines the entire network architecture. For example, the block

View File

@ -35,7 +35,11 @@ template <long num_filters, typename SUBNET> using con5d = con<num_filters,5,5,2
template <long num_filters, typename SUBNET> using con5 = con<num_filters,5,5,1,1,SUBNET>;
template <typename SUBNET> using downsampler = relu<bn_con<con5d<32, relu<bn_con<con5d<32, relu<bn_con<con5d<16,SUBNET>>>>>>>>>;
template <typename SUBNET> using rcon5 = relu<bn_con<con5<55,SUBNET>>>;
using net_type = loss_mmod<con<1,9,9,1,1,rcon5<rcon5<rcon5<downsampler<input_rgb_image_pyramid<pyramid_down<6>>>>>>>>;
// using net_type = loss_mmod<con<1,9,9,1,1,rcon5<rcon5<rcon5<downsampler<input_rgb_image_pyramid<pyramid_down<6>>>>>>>>;
// scale1<sig<con<55,1,1,1,1,avg_pool_everything<tag1<
using net_type = loss_mmod<con<1,9,9,1,1,
scale_prev2<skip1<tag2<sig<con<55,1,1,1,1,avg_pool_everything<tag1<
rcon5<rcon5<rcon5<downsampler<input_rgb_image_pyramid<pyramid_down<6>>>>>>>>>>>>>>>;
// ----------------------------------------------------------------------------------------