| 554 | // ---------------------------------------------------------------------------------------- |
| 555 | |
| 556 | int main(int argc, char** argv) try |
| 557 | { |
| 558 | if (argc != 6) |
| 559 | { |
| 560 | cout << "To use this program, give it an xml file generated by dlib::net_to_xml() " << endl; |
| 561 | cout << "and then 4 numbers that indicate the input tensor size. It will convert " << endl; |
| 562 | cout << "the xml file into a python file that outputs a caffe model containing the dlib model." << endl; |
| 563 | cout << "For example, you might run this program like this: " << endl; |
| 564 | cout << " ./dtoc lenet.xml 1 1 28 28" << endl; |
| 565 | cout << "would convert the lenet.xml model into a caffe model with an input tensor of shape(1,1,28,28)" << endl; |
| 566 | cout << "where the shape values are (num samples in batch, num channels, num rows, num columns)." << endl; |
| 567 | return 0; |
| 568 | } |
| 569 | |
| 570 | const long N = sa = argv[2]; |
| 571 | const long K = sa = argv[3]; |
| 572 | const long NR = sa = argv[4]; |
| 573 | const long NC = sa = argv[5]; |
| 574 | |
| 575 | convert_dlib_xml_to_caffe_python_code(argv[1], N, K, NR, NC); |
| 576 | |
| 577 | return 0; |
| 578 | } |
| 579 | catch(std::exception& e) |
| 580 | { |
| 581 | cout << "\n\n*************** ERROR CONVERTING TO CAFFE ***************\n" << e.what() << endl; |
| 582 | return 1; |
| 583 | } |
| 584 | |
| 585 | // ---------------------------------------------------------------------------------------- |
| 586 | // ---------------------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected