|
@@ -1552,15 +1552,29 @@ void SemSegContextTree::semanticseg (CachedExample *ce, NICE::Image & segresult,
|
|
|
|
|
|
if(useCategorization)
|
|
|
{
|
|
|
- globalCategorFeat->setDim(uniquenumber);
|
|
|
- globalCategorFeat->normalize();
|
|
|
- ClassificationResult cr = fasthik->classify(globalCategorFeat);
|
|
|
- for (uint i = 0; i < classes; i++)
|
|
|
+ if(cndir != "")
|
|
|
+ {
|
|
|
+ ifstream infile ((cndir + "/" + orgname + ".dat").c_str());
|
|
|
+ while (!infile.eof() && infile.good())
|
|
|
+ {
|
|
|
+ int tmp;
|
|
|
+ infile >> tmp;
|
|
|
+ assert (tmp >= 0 && tmp < allClasses);
|
|
|
+ classesInImg.push_back(tmp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- cerr << cr.scores[i] << " ";
|
|
|
- if(cr.scores[i] > 0.0/*-0.3*/)
|
|
|
+ globalCategorFeat->setDim(uniquenumber);
|
|
|
+ globalCategorFeat->normalize();
|
|
|
+ ClassificationResult cr = fasthik->classify(globalCategorFeat);
|
|
|
+ for (uint i = 0; i < classes; i++)
|
|
|
{
|
|
|
- classesInImg.push_back(i);
|
|
|
+ cerr << cr.scores[i] << " ";
|
|
|
+ if(cr.scores[i] > 0.0/*-0.3*/)
|
|
|
+ {
|
|
|
+ classesInImg.push_back(i);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
cerr << "amount of classes: " << classes << " used classes: " << classesInImg.size() << endl;
|