FeatureLearningGeneric.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @file FeatureLearningGeneric.cpp
  3. * @brief abstract interface for feature learning algorithms
  4. * @author Alexander Freytag
  5. * @date 16-04-2013 (dd-mm-yyyy)
  6. */
  7. #include <iostream>
  8. #include <vislearning/baselib/Preprocess.h>
  9. #include "FeatureLearningGeneric.h"
  10. using namespace OBJREC;
  11. using namespace std;
  12. using namespace NICE;
  13. FeatureLearningGeneric::FeatureLearningGeneric ( const Config *_conf, const std::string & _section )
  14. {
  15. this->section = _section;
  16. this->conf = _conf;
  17. this->cacheInitialCodebook = this->conf->gS(this->section, "cacheInitialCodebook", "");
  18. this-> b_loadInitialCodebook = this->conf->gB(this->section, "loadInitialCodebook", "");
  19. this-> b_saveInitialCodebook = this->conf->gB(this->section, "saveInitialCodebook", "");
  20. this->b_evaluationWhileFeatureLearning = this->conf->gB( this->section, "evaluationWhileFeatureLearning", false );
  21. Preprocess::Init ( _conf );
  22. }
  23. FeatureLearningGeneric::~FeatureLearningGeneric()
  24. {
  25. }
  26. void FeatureLearningGeneric::learnNewFeatures ( const std::string & _filename )
  27. {
  28. // Globals::setCurrentImgFN ( filename );
  29. // CachedExample *ce;
  30. // if ( imagetype == IMAGETYPE_RGB )
  31. // {
  32. // NICE::ColorImage img = Preprocess::ReadImgAdvRGB ( filename );
  33. // ce = new CachedExample ( img );
  34. // } else {
  35. //
  36. // NICE::Image img = Preprocess::ReadImgAdv ( filename );
  37. // ce = new CachedExample ( img );
  38. // }
  39. // fprintf ( stderr, "Starting Semantic Segmentation !\n" );
  40. // learnNewFeatures ( ce );
  41. // delete ce;
  42. }