| 141 | // ---------------------------------------------------------------------------------------- |
| 142 | |
| 143 | void bind_object_detection(py::module& m) |
| 144 | { |
| 145 | { |
| 146 | typedef simple_object_detector_training_options type; |
| 147 | py::class_<type>(m, "simple_object_detector_training_options", |
| 148 | "This object is a container for the options to the train_simple_object_detector() routine.") |
| 149 | .def(py::init()) |
| 150 | .def("__str__", &::print_simple_object_detector_training_options) |
| 151 | .def("__repr__", &::print_simple_object_detector_training_options) |
| 152 | .def_readwrite("be_verbose", &type::be_verbose, |
| 153 | "If true, train_simple_object_detector() will print out a lot of information to the screen while training.") |
| 154 | .def_readwrite("add_left_right_image_flips", &type::add_left_right_image_flips, |
| 155 | "if true, train_simple_object_detector() will assume the objects are \n\ |
| 156 | left/right symmetric and add in left right flips of the training \n\ |
| 157 | images. This doubles the size of the training dataset.") |
| 158 | .def_readwrite("detection_window_size", &type::detection_window_size, |
| 159 | "The sliding window used will have about this many pixels inside it.") |
| 160 | .def_readwrite("nuclear_norm_regularization_strength", &type::nuclear_norm_regularization_strength, |
| 161 | "This detector works by convolving a filter over a HOG feature image. If that \n\ |
| 162 | filter is separable then the convolution can be performed much faster. The \n\ |
| 163 | nuclear_norm_regularization_strength parameter encourages the machine learning \n\ |
| 164 | algorithm to learn a separable filter. A value of 0 disables this feature, but \n\ |
| 165 | any non-zero value places a nuclear norm regularizer on the objective function \n\ |
| 166 | and this encourages the learning of a separable filter. Note that setting \n\ |
| 167 | nuclear_norm_regularization_strength to a non-zero value can make the training \n\ |
| 168 | process take significantly longer, so be patient when using it." |
| 169 | /*! |
| 170 | This detector works by convolving a filter over a HOG feature image. If that |
| 171 | filter is separable then the convolution can be performed much faster. The |
| 172 | nuclear_norm_regularization_strength parameter encourages the machine learning |
| 173 | algorithm to learn a separable filter. A value of 0 disables this feature, but |
| 174 | any non-zero value places a nuclear norm regularizer on the objective function |
| 175 | and this encourages the learning of a separable filter. Note that setting |
| 176 | nuclear_norm_regularization_strength to a non-zero value can make the training |
| 177 | process take significantly longer, so be patient when using it. |
| 178 | !*/ |
| 179 | ) |
| 180 | .def_readwrite("max_runtime_seconds", &type::max_runtime_seconds, |
| 181 | "Don't let the solver run for longer than this many seconds.") |
| 182 | .def_readwrite("C", &type::C, |
| 183 | "C is the usual SVM C regularization parameter. So it is passed to \n\ |
| 184 | structural_object_detection_trainer::set_c(). Larger values of C \n\ |
| 185 | will encourage the trainer to fit the data better but might lead to \n\ |
| 186 | overfitting. Therefore, you must determine the proper setting of \n\ |
| 187 | this parameter experimentally.") |
| 188 | .def_readwrite("epsilon", &type::epsilon, |
| 189 | "epsilon is the stopping epsilon. Smaller values make the trainer's \n\ |
| 190 | solver more accurate but might take longer to train.") |
| 191 | .def_readwrite("num_threads", &type::num_threads, |
| 192 | "train_simple_object_detector() will use this many threads of \n\ |
| 193 | execution. Set this to the number of CPU cores on your machine to \n\ |
| 194 | obtain the fastest training speed.") |
| 195 | .def_readwrite("upsample_limit", &type::upsample_limit, |
| 196 | "train_simple_object_detector() will upsample images if needed \n\ |
| 197 | no more than upsample_limit times. Value 0 will forbid trainer to \n\ |
| 198 | upsample any images. If trainer is unable to fit all boxes with \n\ |
| 199 | required upsample_limit, exception will be thrown. Higher values \n\ |
| 200 | of upsample_limit exponentially increases memory requirements. \n\ |
no test coverage detected