Bläddra i källkod

changes to SemSegNovelty: default init of iterationCountSuffix; regrouping of visual debug outputs

Johannes Ruehle 11 år sedan
förälder
incheckning
2b04bc117e
2 ändrade filer med 16 tillägg och 16 borttagningar
  1. 13 15
      semseg/SemSegNovelty.cpp
  2. 3 1
      semseg/SemanticSegmentation.cpp

+ 13 - 15
semseg/SemSegNovelty.cpp

@@ -792,27 +792,25 @@ void SemSegNovelty::semanticseg ( CachedExample *ce, NICE::Image & segresult, NI
   timer.stop();
   std::cout << "AL time for determination of novel regions: " << timer.getLastAbsolute() << std::endl;
 
-//   timer.stop();
-//   cout << "second: " << timer.getLastAbsolute() << endl;
-  timer.start();
-
-  ColorImage imgrgb ( xsize, ysize );
-
-  std::stringstream out;
-  std::vector< std::string > list2;
-  StringTools::split ( Globals::getCurrentImgFN (), '/', list2 );
-  out << resultdir << "/" << list2.back();
-  
-  noveltyImage.writeRaw(out.str() + "_run_" +  NICE::intToString(this->iterationCountSuffix) + "_" + noveltyMethodString+".rawfloat");
-  
   if (b_visualizeALimages)
   {
+    timer.start();
+
+    std::stringstream out;
+    std::vector< std::string > list2;
+    StringTools::split ( Globals::getCurrentImgFN (), '/', list2 );
+    out << resultdir << "/" << list2.back();
+
+    noveltyImage.writeRaw(out.str() + "_run_" +  NICE::intToString(this->iterationCountSuffix) + "_" + noveltyMethodString+".rawfloat");
+
+    ColorImage imgrgb ( xsize, ysize );
     ICETools::convertToRGB ( noveltyImage, imgrgb );
     showImage(imgrgb, "Novelty Image");
+
+    timer.stop();
+    cout << "AL time for writing the raw novelty image: " << timer.getLastAbsolute() << endl;
   }
 
-  timer.stop();
-  cout << "AL time for writing the raw novelty image: " << timer.getLastAbsolute() << endl;
 }
 
 inline void SemSegNovelty::computeClassificationResults( const NICE::MultiChannelImageT<double> & feats, 

+ 3 - 1
semseg/SemanticSegmentation.cpp

@@ -21,6 +21,7 @@ using namespace NICE;
 ///////////////////// ///////////////////// /////////////////////     
 
 SemanticSegmentation::SemanticSegmentation ( )
+    : iterationCountSuffix(1)
 {
   this->imagetype = IMAGETYPE_RGB;
   
@@ -30,7 +31,8 @@ SemanticSegmentation::SemanticSegmentation ( )
 
 
 SemanticSegmentation::SemanticSegmentation ( const Config *conf,
-    const ClassNames *classNames )
+                                             const ClassNames *classNames )
+    : iterationCountSuffix(1)
 {
   ///////////
   // same code as in empty constructor - duplication can be avoided with C++11 allowing for constructor delegation