LabeledFileList.h~ 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @file LabeledFileList.h
  3. * @brief reads images from directory
  4. * @author Erik Rodner
  5. * @date 17.09.2007
  6. */
  7. #ifndef LabeledFileListINCLUDE
  8. #define LabeledFileListINCLUDE
  9. #include <string>
  10. #include "core/basics/Config.h"
  11. #include "vislearning/baselib/ProgressBar.h"
  12. #include "ClassNames.h"
  13. #include "LocalizationResult.h"
  14. #include "LabeledSet.h"
  15. #include "LabeledSetFactory.h"
  16. namespace OBJREC {
  17. /**
  18. * @brief reads images from directory
  19. */
  20. class LabeledFileList
  21. {
  22. private:
  23. bool debug_dataset;
  24. LabeledSetFactory *m_pLabeledSetFactory;
  25. public:
  26. /** simple constructor */
  27. LabeledFileList();
  28. /** simple destructor */
  29. virtual ~LabeledFileList();
  30. LocalizationResult *getLocalizationInfo ( const ClassNames & classnames,
  31. int classno,
  32. const std::string & file,
  33. const NICE::Config & conf ) const;
  34. /**
  35. * @brief extract multiple label information from different sources.
  36. *
  37. * Different sources specified in the logfile under section "main":
  38. *-"pattern" <br>
  39. *-"filelist" <br>
  40. *-"factoryxml" <br>
  41. * xml file whose information is extracted and inserted into a LabeledSet. In order to use the right xml loader, a factory had to be provided
  42. * ( ::setFactory() ). [Johannes Ruehle]
  43. * @see LabeledSetFactory
  44. */
  45. void get ( const std::string & dir,
  46. const NICE::Config & datasetconf,
  47. const ClassNames & classnames,
  48. LabeledSet & ls,
  49. bool localizationInfoDisabled = false,
  50. bool debugDataset = false );
  51. void getFromPattern ( const std::string & dir,
  52. const NICE::Config & datasetconf,
  53. const ClassNames & classnames,
  54. LabeledSet & ls,
  55. bool localizationInfoDisabled = false ) const;
  56. /** simple destructor */
  57. virtual ~LabeledFileList();
  58. LocalizationResult *getLocalizationInfo ( const ClassNames & classnames,
  59. int classno,
  60. const std::string & file,
  61. const NICE::Config & conf ) const;
  62. void get ( const std::string & dir,
  63. const NICE::Config & datasetconf,
  64. const ClassNames & classnames,
  65. LabeledSet & ls,
  66. bool localizationInfoDisabled = false,
  67. bool debugDataset = false );
  68. void getFromPattern ( const std::string & dir,
  69. const NICE::Config & datasetconf,
  70. const ClassNames & classnames,
  71. LabeledSet & ls,
  72. bool localizationInfoDisabled = false ) const;
  73. void getFromList ( const std::string & filelist,
  74. const NICE::Config & datasetconf,
  75. const ClassNames & classnames,
  76. LabeledSet & ls,
  77. bool localizationInfoDisabled = false ) const;
  78. void setFactory(LabeledSetFactory *pLabeledSetFactory)
  79. {
  80. m_pLabeledSetFactory = pLabeledSetFactory;
  81. }
  82. };
  83. } // namespace
  84. #endif