Commit 25bf3c51 authored by Davis King's avatar Davis King

Simplified code a bit

parent 7c4cde7f
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "common.h" #include "common.h"
#include <fstream> #include <fstream>
#include <dlib/error.h>
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#define DLIB_IMGLAB_COmMON_H__ #define DLIB_IMGLAB_COmMON_H__
#include <string> #include <string>
#include <dlib/cmd_line_parser.h>
typedef dlib::cmd_line_parser<char>::check_1a_c parser_type;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <string> #include <string>
#include <dlib/dir_nav.h> #include <dlib/dir_nav.h>
#include <dlib/time_this.h> #include <dlib/time_this.h>
#include <dlib/cmd_line_parser.h>
using namespace std; using namespace std;
using namespace dlib; using namespace dlib;
...@@ -163,7 +164,7 @@ namespace ...@@ -163,7 +164,7 @@ namespace
} }
void convert_idl( void convert_idl(
const parser_type& parser const command_line_parser& parser
) )
{ {
cout << "Convert from IDL annotation format..." << endl; cout << "Convert from IDL annotation format..." << endl;
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
#define DLIB_IMGLAB_CONVErT_IDL_H__ #define DLIB_IMGLAB_CONVErT_IDL_H__
#include "common.h" #include "common.h"
#include <dlib/cmd_line_parser.h>
void convert_idl(const parser_type& parser); void convert_idl(const dlib::command_line_parser& parser);
#endif // DLIB_IMGLAB_CONVErT_IDL_H__ #endif // DLIB_IMGLAB_CONVErT_IDL_H__
......
...@@ -137,7 +137,7 @@ namespace ...@@ -137,7 +137,7 @@ namespace
} }
void convert_pascal_v1( void convert_pascal_v1(
const parser_type& parser const command_line_parser& parser
) )
{ {
cout << "Convert from PASCAL v1.00 annotation format..." << endl; cout << "Convert from PASCAL v1.00 annotation format..." << endl;
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
#define DLIB_IMGLAB_CONVERT_PASCAl_V1_H__ #define DLIB_IMGLAB_CONVERT_PASCAl_V1_H__
#include "common.h" #include "common.h"
#include <dlib/cmd_line_parser.h>
void convert_pascal_v1(const parser_type& parser); void convert_pascal_v1(const dlib::command_line_parser& parser);
#endif // DLIB_IMGLAB_CONVERT_PASCAl_V1_H__ #endif // DLIB_IMGLAB_CONVERT_PASCAl_V1_H__
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <dlib/xml_parser.h> #include <dlib/xml_parser.h>
#include <string> #include <string>
#include <dlib/dir_nav.h> #include <dlib/dir_nav.h>
#include <dlib/cmd_line_parser.h>
using namespace std; using namespace std;
using namespace dlib; using namespace dlib;
...@@ -197,7 +198,7 @@ namespace ...@@ -197,7 +198,7 @@ namespace
} }
void convert_pascal_xml( void convert_pascal_xml(
const parser_type& parser const command_line_parser& parser
) )
{ {
cout << "Convert from PASCAL XML annotation format..." << endl; cout << "Convert from PASCAL XML annotation format..." << endl;
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
#define DLIB_IMGLAB_CONVERT_PASCAl_XML_H__ #define DLIB_IMGLAB_CONVERT_PASCAl_XML_H__
#include "common.h" #include "common.h"
#include <dlib/cmd_line_parser.h>
void convert_pascal_xml(const parser_type& parser); void convert_pascal_xml(const dlib::command_line_parser& parser);
#endif // DLIB_IMGLAB_CONVERT_PASCAl_XML_H__ #endif // DLIB_IMGLAB_CONVERT_PASCAl_XML_H__
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "convert_pascal_xml.h" #include "convert_pascal_xml.h"
#include "convert_pascal_v1.h" #include "convert_pascal_v1.h"
#include "convert_idl.h" #include "convert_idl.h"
#include <dlib/cmd_line_parser.h>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
...@@ -24,7 +25,7 @@ using namespace dlib; ...@@ -24,7 +25,7 @@ using namespace dlib;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
void create_new_dataset ( void create_new_dataset (
const parser_type& parser const command_line_parser& parser
) )
{ {
using namespace dlib::image_dataset_metadata; using namespace dlib::image_dataset_metadata;
...@@ -118,7 +119,7 @@ int main(int argc, char** argv) ...@@ -118,7 +119,7 @@ int main(int argc, char** argv)
try try
{ {
parser_type parser; command_line_parser parser;
parser.add_option("h","Displays this information."); parser.add_option("h","Displays this information.");
parser.add_option("c","Create an XML file named <arg> listing a set of images.",1); parser.add_option("c","Create an XML file named <arg> listing a set of images.",1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment