| 771 | // ---------------------------------------------------------------------------------------- |
| 772 | |
| 773 | std::vector<layer> parse_dlib_xml( |
| 774 | const matrix<long,4,1>& input_tensor_shape, |
| 775 | const string& xml_filename |
| 776 | ) |
| 777 | { |
| 778 | doc_handler dh; |
| 779 | parse_xml(xml_filename, dh); |
| 780 | if (dh.layers.size() == 0) |
| 781 | throw dlib::error("No layers found in XML file!"); |
| 782 | |
| 783 | if (dh.layers.back().type != "input") |
| 784 | throw dlib::error("The network in the XML file is missing an input layer!"); |
| 785 | |
| 786 | compute_output_tensor_shapes(input_tensor_shape, dh.layers); |
| 787 | |
| 788 | return dh.layers; |
| 789 | } |
| 790 | |
| 791 | // ---------------------------------------------------------------------------------------- |
| 792 |
no test coverage detected