12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /**
- * @file testLabeledSet.cpp
- * @brief test multidataset
- * @author Erik Rodner
- * @date 03/03/2008
- */
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/image/ImageT.h"
- #include <core/basics/Config.h>
- #include <vislearning/baselib/cmdline.h>
- #include <vislearning/cbaselib/MultiDataset.h>
- 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;
- }
|