Bjoern Froehlich 12 vuotta sitten
vanhempi
commit
8a0af72423
1 muutettua tiedostoa jossa 12 lisäystä ja 0 poistoa
  1. 12 0
      semseg/SemSegContextTree.cpp

+ 12 - 0
semseg/SemSegContextTree.cpp

@@ -969,6 +969,10 @@ void SemSegContextTree::train (const MultiDataset *md)
                     feat.tree = &forest[tree];
                     feat.rProbs = &lastRegionProbs[iCounter];
                     double val = splitfeat->getVal (feat, x, y);
+                    if(!isfinite(val))
+                    {
+                      val = 0.0;
+                    }
 
 #pragma omp critical
                     if (val < splitval)
@@ -1043,6 +1047,10 @@ void SemSegContextTree::train (const MultiDataset *md)
                       feat.rProbs = &lastRegionProbs[iCounter];
 
                       double val = splitfeat->getVal (feat, x, y);
+                      if(!isfinite(val))
+                      {
+                        val = 0.0;
+                      }
 
                       cout << "splitval: " << splitval << " val: " << val << endl;
                     }
@@ -1469,6 +1477,10 @@ void SemSegContextTree::semanticseg (CachedExample *ce, NICE::Image & segresult,
             feat.rProbs = &lastRegionProbs;
 
             double val = forest[tree][t].feat->getVal (feat, x, y);
+            if(!isfinite(val))
+            {
+              val = 0.0;
+            }
 
             if (val < forest[tree][t].decision)
             {