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

Function throw_invalid_box_error_message

examples/train_object_detector.cpp:143–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141// ----------------------------------------------------------------------------------------
142
143void throw_invalid_box_error_message (
144 const std::string& dataset_filename,
145 const std::vector<std::vector<rectangle> >& removed,
146 const unsigned long target_size
147)
148{
149 image_dataset_metadata::dataset data;
150 load_image_dataset_metadata(data, dataset_filename);
151
152 std::ostringstream sout;
153 sout << "Error! An impossible set of object boxes was given for training. ";
154 sout << "All the boxes need to have a similar aspect ratio and also not be ";
155 sout << "smaller than about " << target_size << " pixels in area. ";
156 sout << "The following images contain invalid boxes:\n";
157 std::ostringstream sout2;
158 for (unsigned long i = 0; i < removed.size(); ++i)
159 {
160 if (removed[i].size() != 0)
161 {
162 const std::string imgname = data.images[i].filename;
163 sout2 << " " << imgname << "\n";
164 }
165 }
166 throw error("\n"+wrap_string(sout.str()) + "\n" + sout2.str());
167}
168
169// ----------------------------------------------------------------------------------------
170

Callers 1

mainFunction · 0.70

Calls 5

errorClass · 0.85
wrap_stringFunction · 0.85
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected