LabeledFileList.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. int getClassFromNumber( const std::string & lfile,
  46. const int exampleID ) const;
  47. void get ( const std::string & dir,
  48. const NICE::Config & datasetconf,
  49. const ClassNames & classnames,
  50. LabeledSet & ls,
  51. bool localizationInfoDisabled = false,
  52. bool debugDataset = false );
  53. void getFromPattern ( const std::string & dir,
  54. const NICE::Config & datasetconf,
  55. const ClassNames & classnames,
  56. LabeledSet & ls,
  57. bool localizationInfoDisabled = false ) const;
  58. void getFromList ( const std::string & filelist,
  59. const NICE::Config & datasetconf,
  60. const ClassNames & classnames,
  61. LabeledSet & ls,
  62. bool localizationInfoDisabled = false ) const;
  63. void setFactory(LabeledSetFactory *pLabeledSetFactory)
  64. {
  65. m_pLabeledSetFactory = pLabeledSetFactory;
  66. }
  67. };
  68. } // namespace
  69. #endif