123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /**
- * @file testLabeledSet.cpp
- * @brief test multidataset
- * @author Erik Rodner
- * @date 03/03/2008
- */
- #ifdef NOVISUAL
- #include <vislearning/nice_nonvis.h>
- #else
- #include <vislearning/nice.h>
- #endif
- #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;
- }
|