MultiDataset.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * @file MultiDataset.h
  3. * @brief multiple datasets
  4. * @author Erik Rodner
  5. * @date 02/08/2008
  6. */
  7. #ifndef MULTIDATASETINCLUDE
  8. #define MULTIDATASETINCLUDE
  9. #include <string>
  10. #include <map>
  11. #include <core/basics/Config.h>
  12. #include "LabeledSetSelection.h"
  13. #include "LabeledFileList.h"
  14. #include "LabeledSetFactory.h"
  15. #include "LabeledSet.h"
  16. #include "ClassNames.h"
  17. namespace OBJREC {
  18. /** multiple datasets */
  19. class MultiDataset
  20. {
  21. protected:
  22. LabeledFileList lfl;
  23. std::map<std::string, ClassNames> classnames;
  24. std::map<std::string, LabeledSet> datasets;
  25. void selectExamples ( const std::string & examples_command,
  26. const LabeledSet & base,
  27. LabeledSet & positives,
  28. LabeledSet & negatives,
  29. const ClassNames & cn ) const;
  30. public:
  31. /** Create a new data set consiting of multiple datasets.
  32. *
  33. * @param pSetFactory factory for creating the right loading object (@see LabeledSetCreatorInterface) for a specified xml config file.
  34. * The factory is used when the log tag "factoryxml = < file >.xml" is specified in section " [main] ".
  35. * @see LabeledFileList::get()
  36. */
  37. MultiDataset( const NICE::Config *conf, LabeledSetFactory *pSetFactory = NULL );
  38. /** simple destructor */
  39. virtual ~MultiDataset();
  40. /** access class information, e.g., md.getClassNames("train") */
  41. const ClassNames & getClassNames ( const std::string & key ) const;
  42. ClassNames & getClassNamesNonConst ( const std::string & key );
  43. /** access stored dataset by name, e.g., md["train"], if you have a [train] section
  44. * in your config file */
  45. const LabeledSet * operator[] ( const std::string & key ) const;
  46. const LabeledSet * at ( const std::string & key ) const;
  47. };
  48. } // namespace
  49. #endif