|
@@ -1980,6 +1980,9 @@ void SemSegContextTree::semanticseg ( CachedExample *ce, NICE::Image & segresult
|
|
|
{
|
|
|
useclass = vector<int> ( classes, 0 );
|
|
|
ifstream infile ( ( cndir + "/" + orgname + ".dat" ).c_str() );
|
|
|
+
|
|
|
+#undef OLD
|
|
|
+#ifdef OLD
|
|
|
while ( !infile.eof() && infile.good() )
|
|
|
{
|
|
|
int tmp;
|
|
@@ -1987,6 +1990,27 @@ void SemSegContextTree::semanticseg ( CachedExample *ce, NICE::Image & segresult
|
|
|
assert(tmp >= 0 && tmp < classes);
|
|
|
useclass[tmp] = 1;
|
|
|
}
|
|
|
+#else
|
|
|
+ int c = 0;
|
|
|
+ vector<double> probs(classes, 0.0);
|
|
|
+ while ( !infile.eof() && infile.good() )
|
|
|
+ {
|
|
|
+ infile >> probs[c];
|
|
|
+ c++;
|
|
|
+ }
|
|
|
+
|
|
|
+ vector<double> sorted = probs;
|
|
|
+ sort (sorted.begin(), sorted.end());
|
|
|
+
|
|
|
+ for(int c = 0; c < classes; c++)
|
|
|
+ {
|
|
|
+ if(probs[c] < sorted[3])
|
|
|
+ {
|
|
|
+ useclass[c] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+#endif
|
|
|
|
|
|
for(int c = 0; c < classes; c++)
|
|
|
{
|