/** * @file testLabeledSet.cpp * @brief test multidataset * @author Erik Rodner * @date 03/03/2008 */ #ifdef NOVISUAL #include #else #include #endif #include #include #include using namespace OBJREC; // refactor-nice.pl: check this substitution // old: using namespace ice; using namespace NICE; using namespace std; /** test multidataset */ int main (int argc, char **argv) { std::set_terminate(__gnu_cxx::__verbose_terminate_handler); char configfile [300]; struct CmdLineOption options[] = { {"config", "use config file", NULL, "%s", configfile}, {NULL, NULL, NULL, NULL, NULL} }; int ret; char *more_options[argc]; ret = parse_arguments( argc, (const char**)argv, options, more_options); if ( ret != 0 ) { if ( ret != 1 ) fprintf (stderr, "Error parsing command line !\n"); exit (-1); } Config conf ( configfile ); MultiDataset md ( &conf ); const LabeledSet *train = md["train"]; const LabeledSet *test = md["test"]; const ClassNames & cn = md.getClassNames ( "train" ); fprintf (stderr, "Training Dataset\n"); LOOP_ALL_S( *train ) { EACH_S(classno, fn); fprintf (stderr, "%s %s\n", cn.text(classno).c_str(), fn.c_str() ); } fprintf (stderr, "Test Dataset\n"); LOOP_ALL_S( *test ) { EACH_S(classno, fn); fprintf (stderr, "%s %s\n", cn.text(classno).c_str(), fn.c_str() ); } return 0; }