FeatureLearningGeneric.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. this->b_showTrainingImages = conf->gB( section, "showTrainingImages", false );
  22. this->b_showResults = conf->gB( section, "showResults", false );
  23. this->s_resultdir = conf->gS( section, "resultdir", "/tmp/");
  24. Preprocess::Init ( _conf );
  25. }
  26. FeatureLearningGeneric::~FeatureLearningGeneric()
  27. {
  28. }
  29. void FeatureLearningGeneric::learnNewFeatures ( const std::string & _filename )
  30. {
  31. // Globals::setCurrentImgFN ( filename );
  32. // CachedExample *ce;
  33. // if ( imagetype == IMAGETYPE_RGB )
  34. // {
  35. // NICE::ColorImage img = Preprocess::ReadImgAdvRGB ( filename );
  36. // ce = new CachedExample ( img );
  37. // } else {
  38. //
  39. // NICE::Image img = Preprocess::ReadImgAdv ( filename );
  40. // ce = new CachedExample ( img );
  41. // }
  42. // fprintf ( stderr, "Starting Semantic Segmentation !\n" );
  43. // learnNewFeatures ( ce );
  44. // delete ce;
  45. }