| 175 | // ---------------------------------------------------------------------------------------- |
| 176 | |
| 177 | void parse_annotation_file( |
| 178 | const std::string& file, |
| 179 | dlib::image_dataset_metadata::image& img, |
| 180 | std::string& dataset_name |
| 181 | ) |
| 182 | { |
| 183 | doc_handler dh(img, dataset_name); |
| 184 | xml_error_handler eh; |
| 185 | |
| 186 | xml_parser::kernel_1a parser; |
| 187 | parser.add_document_handler(dh); |
| 188 | parser.add_error_handler(eh); |
| 189 | |
| 190 | ifstream fin(file.c_str()); |
| 191 | if (!fin) |
| 192 | throw dlib::error("Unable to open file " + file); |
| 193 | parser.parse(fin); |
| 194 | } |
| 195 | |
| 196 | // ---------------------------------------------------------------------------------------- |
| 197 |
no test coverage detected