| 141 | // ---------------------------------------------------------------------------------------- |
| 142 | |
| 143 | void 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 |
no test coverage detected