MCPcopy Create free account
hub / github.com/davisking/dlib / bind_object_detection

Function bind_object_detection

tools/python/src/object_detection.cpp:143–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141// ----------------------------------------------------------------------------------------
142
143void 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\
156left/right symmetric and add in left right flips of the training \n\
157images. 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\
162filter is separable then the convolution can be performed much faster. The \n\
163nuclear_norm_regularization_strength parameter encourages the machine learning \n\
164algorithm to learn a separable filter. A value of 0 disables this feature, but \n\
165any non-zero value places a nuclear norm regularizer on the objective function \n\
166and this encourages the learning of a separable filter. Note that setting \n\
167nuclear_norm_regularization_strength to a non-zero value can make the training \n\
168process 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\
184structural_object_detection_trainer::set_c(). Larger values of C \n\
185will encourage the trainer to fit the data better but might lead to \n\
186overfitting. Therefore, you must determine the proper setting of \n\
187this parameter experimentally.")
188 .def_readwrite("epsilon", &type::epsilon,
189"epsilon is the stopping epsilon. Smaller values make the trainer's \n\
190solver 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\
193execution. Set this to the number of CPU cores on your machine to \n\
194obtain the fastest training speed.")
195 .def_readwrite("upsample_limit", &type::upsample_limit,
196"train_simple_object_detector() will upsample images if needed \n\
197no more than upsample_limit times. Value 0 will forbid trainer to \n\
198upsample any images. If trainer is unable to fit all boxes with \n\
199required upsample_limit, exception will be thrown. Higher values \n\
200of upsample_limit exponentially increases memory requirements. \n\

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 9

initFunction · 0.85
make_tupleFunction · 0.85
pickleFunction · 0.85
num_separable_filtersFunction · 0.85
num_detectorsMethod · 0.80
argClass · 0.50

Tested by

no test coverage detected