2 ///////////////////////////////////////////////////////////////////////////
3 // This program is free software: you can redistribute it and/or modify //
4 // it under the terms of the version 3 of the GNU General Public License //
5 // as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // You should have received a copy of the GNU General Public License //
13 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
15 // Written by Francois Fleuret, (C) IDIAP //
16 // Contact <francois.fleuret@idiap.ch> for comments & bug reports //
17 ///////////////////////////////////////////////////////////////////////////
27 #include "param_parser.h"
28 #include "progress_bar.h"
30 enum { LOSS_EXPONENTIAL,
39 int pictures_for_article;
41 char pool_name[buffer_size];
42 char test_pool_name[buffer_size];
43 char detector_name[buffer_size];
44 char result_path[buffer_size];
46 char materials_image_numbers[buffer_size];
47 char materials_pf_numbers[buffer_size];
55 int nb_weak_learners_per_classifier;
56 int nb_classifiers_per_level;
59 scalar_t proportion_negative_cells_for_training;
60 int nb_negative_samples_per_positive;
61 int nb_features_for_boosting_optimization;
62 int force_head_belly_independence;
64 scalar_t proportion_for_train;
65 scalar_t proportion_for_validation;
66 scalar_t proportion_for_test;
67 bool write_validation_rocs;
68 bool write_parse_images;
69 bool write_tag_images;
70 scalar_t wanted_true_positive_rate;
71 int nb_wanted_true_positive_rates;
73 int nb_scales_per_power_of_two;
74 scalar_t min_head_radius;
75 scalar_t max_head_radius;
76 int root_cell_nb_xy_per_scale;
78 scalar_t pi_feature_window_min_size;
85 void init_parser(ParamParser *parser);
86 void read_parser(ParamParser *parser);
90 inline int scale_to_discrete_log_scale(scalar_t scale_ratio) {
91 return int(floor(log(scale_ratio) / log(2.0) * nb_scales_per_power_of_two));
94 inline scalar_t discrete_log_scale_to_scale(int discrete_scale) {
95 return exp( - scalar_t(discrete_scale) * log(2.0) / scalar_t(nb_scales_per_power_of_two));