Browse Source

measuring time for classification

Sven Sickert 10 years ago
parent
commit
416f282ba6
1 changed files with 7 additions and 0 deletions
  1. 7 0
      progs/testSemSegConvTrees.cpp

+ 7 - 0
progs/testSemSegConvTrees.cpp

@@ -8,6 +8,7 @@
 
 #include "core/basics/StringTools.h"
 #include "core/basics/ResourceStatistics.h"
+#include "core/basics/Timer.h"
 
 #include "semseg/semseg/SemSegConvolutionalTree.h"
 #include "semseg/semseg/SemSegTools.h"
@@ -46,6 +47,7 @@ int main ( int argc, char **argv )
     semseg->train( &md );
 
     // testing
+    NICE::Timer timer;
     std::cout << "\nCLASSIFICATION" << std::endl;
     std::cout << "##############\n" << std::endl;
     for (LabeledSet::const_iterator it = testFiles->begin(); it != testFiles->end(); it++)
@@ -75,7 +77,12 @@ int main ( int argc, char **argv )
 
             // actual testing
             NICE::MultiChannelImageT<double> probabilities;
+
+            timer.start();
             semseg->semanticseg( file, segresult, probabilities );
+            timer.stop();
+            std::cout << "Time for Classification: " << timer.getLastAbsolute()
+                      << "\n\n";
 
             // updating confusion matrix
             SemSegTools::updateConfusionMatrix (