|
@@ -19,12 +19,8 @@ using namespace std;
|
|
using namespace NICE;
|
|
using namespace NICE;
|
|
using namespace OBJREC;
|
|
using namespace OBJREC;
|
|
|
|
|
|
-SemSegNovelty::SemSegNovelty ( const Config *conf,
|
|
|
|
- const MultiDataset *md )
|
|
|
|
- : SemanticSegmentation ( conf, & ( md->getClassNames ( "train" ) ) )
|
|
|
|
|
|
+void SemSegNovelty::init()
|
|
{
|
|
{
|
|
- this->conf = conf;
|
|
|
|
-
|
|
|
|
globalMaxUncert = -numeric_limits<double>::max();
|
|
globalMaxUncert = -numeric_limits<double>::max();
|
|
|
|
|
|
string section = "SemSegNovelty";
|
|
string section = "SemSegNovelty";
|
|
@@ -39,23 +35,6 @@ SemSegNovelty::SemSegNovelty ( const Config *conf,
|
|
resultdir = conf->gS("debug", "resultdir", "result");
|
|
resultdir = conf->gS("debug", "resultdir", "result");
|
|
cache = conf->gS ( "cache", "root", "" );
|
|
cache = conf->gS ( "cache", "root", "" );
|
|
|
|
|
|
-
|
|
|
|
- //stupid work around of the const attribute
|
|
|
|
- Config confCopy = *conf;
|
|
|
|
-
|
|
|
|
- //just to make sure, that we do NOT perform an optimization after every iteration step
|
|
|
|
- //this would just take a lot of time, which is not desired so far
|
|
|
|
- confCopy.sB("ClassifierGPHIK","performOptimizationAfterIncrement",false);
|
|
|
|
-
|
|
|
|
- classifierString = conf->gS ( section, "classifier", "ClassifierGPHIK" );
|
|
|
|
- classifier = NULL;
|
|
|
|
- vclassifier = NULL;
|
|
|
|
- if ( classifierString.compare("ClassifierGPHIK") == 0)
|
|
|
|
- classifier = new GPHIKClassifierNICE ( &confCopy, "ClassifierGPHIK" );
|
|
|
|
- else
|
|
|
|
- vclassifier = GenericClassifierSelection::selectVecClassifier ( conf, classifierString );
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
findMaximumUncert = conf->gB(section, "findMaximumUncert", true);
|
|
findMaximumUncert = conf->gB(section, "findMaximumUncert", true);
|
|
whs = conf->gI ( section, "window_size", 10 );
|
|
whs = conf->gI ( section, "window_size", 10 );
|
|
@@ -79,38 +58,6 @@ SemSegNovelty::SemSegNovelty ( const Config *conf,
|
|
regionSeg = tmpRegionSeg;
|
|
regionSeg = tmpRegionSeg;
|
|
}
|
|
}
|
|
|
|
|
|
- cn = md->getClassNames ( "train" );
|
|
|
|
-
|
|
|
|
- if ( read_classifier )
|
|
|
|
- {
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- if ( classifier != NULL )
|
|
|
|
- {
|
|
|
|
- string classifierdst = "/classifier.data";
|
|
|
|
- fprintf ( stderr, "SemSegNovelty:: Reading classifier data from %s\n", ( cache + classifierdst ).c_str() );
|
|
|
|
- classifier->read ( cache + classifierdst );
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- string classifierdst = "/veccl.data";
|
|
|
|
- fprintf ( stderr, "SemSegNovelty:: Reading classifier data from %s\n", ( cache + classifierdst ).c_str() );
|
|
|
|
- vclassifier->read ( cache + classifierdst );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- fprintf ( stderr, "SemSegNovelty:: successfully read\n" );
|
|
|
|
- }
|
|
|
|
- catch ( char *str )
|
|
|
|
- {
|
|
|
|
- cerr << "error reading data: " << str << endl;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- train ( md );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//define which measure for "novelty" we want to use
|
|
//define which measure for "novelty" we want to use
|
|
noveltyMethodString = conf->gS( section, "noveltyMethod", "gp-variance");
|
|
noveltyMethodString = conf->gS( section, "noveltyMethod", "gp-variance");
|
|
if (noveltyMethodString.compare("gp-variance") == 0) // novel = large variance
|
|
if (noveltyMethodString.compare("gp-variance") == 0) // novel = large variance
|
|
@@ -163,7 +110,62 @@ SemSegNovelty::SemSegNovelty ( const Config *conf,
|
|
|
|
|
|
//we don't have queried any region so far
|
|
//we don't have queried any region so far
|
|
queriedRegions.clear();
|
|
queriedRegions.clear();
|
|
- visualizeALimages = conf->gB(section, "visualizeALimages", false);
|
|
|
|
|
|
+ visualizeALimages = conf->gB(section, "visualizeALimages", false);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+SemSegNovelty::SemSegNovelty ( const Config * _conf,
|
|
|
|
+ const MultiDataset *md )
|
|
|
|
+ : SemanticSegmentation ( _conf, & ( md->getClassNames ( "train" ) ) )
|
|
|
|
+{
|
|
|
|
+ this->conf = new NICE::Config ( *_conf );
|
|
|
|
+
|
|
|
|
+ // set internal variables, default values, and all those funny things
|
|
|
|
+ this->init ( );
|
|
|
|
+
|
|
|
|
+ std::string section = "SemSegNovelty";
|
|
|
|
+
|
|
|
|
+ classifierString = conf->gS ( section, "classifier", "GPHIKClassifier" );
|
|
|
|
+ classifier = NULL;
|
|
|
|
+ vclassifier = NULL;
|
|
|
|
+ if ( classifierString.compare("GPHIKClassifier") == 0)
|
|
|
|
+ {
|
|
|
|
+ //just to make sure, that we do NOT perform an optimization after every iteration step
|
|
|
|
+ //this would just take a lot of time, which is not desired so far
|
|
|
|
+ this->conf->sB( "GPHIKClassifier", "performOptimizationAfterIncrement", false );
|
|
|
|
+ classifier = new GPHIKClassifierNICE ( this->conf, "GPHIKClassifier" );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ vclassifier = GenericClassifierSelection::selectVecClassifier ( this->conf, classifierString );
|
|
|
|
+
|
|
|
|
+ if ( read_classifier )
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if ( classifier != NULL )
|
|
|
|
+ {
|
|
|
|
+ string classifierdst = "/classifier.data";
|
|
|
|
+ fprintf ( stderr, "SemSegNovelty:: Reading classifier data from %s\n", ( cache + classifierdst ).c_str() );
|
|
|
|
+ classifier->read ( cache + classifierdst );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ string classifierdst = "/veccl.data";
|
|
|
|
+ fprintf ( stderr, "SemSegNovelty:: Reading classifier data from %s\n", ( cache + classifierdst ).c_str() );
|
|
|
|
+ vclassifier->read ( cache + classifierdst );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ fprintf ( stderr, "SemSegNovelty:: successfully read\n" );
|
|
|
|
+ }
|
|
|
|
+ catch ( char *str )
|
|
|
|
+ {
|
|
|
|
+ cerr << "error reading data: " << str << endl;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ train ( md );
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
SemSegNovelty::~SemSegNovelty()
|
|
SemSegNovelty::~SemSegNovelty()
|
|
@@ -191,6 +193,7 @@ SemSegNovelty::~SemSegNovelty()
|
|
delete featExtract;
|
|
delete featExtract;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
void SemSegNovelty::visualizeRegion(const NICE::ColorImage &img, const NICE::Matrix ®ions, int region, NICE::ColorImage &outimage)
|
|
void SemSegNovelty::visualizeRegion(const NICE::ColorImage &img, const NICE::Matrix ®ions, int region, NICE::ColorImage &outimage)
|
|
{
|
|
{
|
|
std::vector<uchar> color;
|
|
std::vector<uchar> color;
|
|
@@ -240,7 +243,7 @@ void SemSegNovelty::train ( const MultiDataset *md )
|
|
{
|
|
{
|
|
forbidden_classesTrain_s = conf->gS ( "analysis", "forbidden_classesTrain", "" );
|
|
forbidden_classesTrain_s = conf->gS ( "analysis", "forbidden_classesTrain", "" );
|
|
}
|
|
}
|
|
- cn.getSelection ( forbidden_classesTrain_s, forbidden_classesTrain );
|
|
|
|
|
|
+ this->classNames->getSelection ( forbidden_classesTrain_s, forbidden_classesTrain );
|
|
|
|
|
|
|
|
|
|
ProgressBar pb ( "Local Feature Extraction" );
|
|
ProgressBar pb ( "Local Feature Extraction" );
|
|
@@ -433,7 +436,7 @@ void SemSegNovelty::semanticseg ( CachedExample *ce, NICE::Image & segresult, NI
|
|
|
|
|
|
//segResult contains the GT labels when this method is called
|
|
//segResult contains the GT labels when this method is called
|
|
// we simply store them in labels, to have an easy access to the GT information lateron
|
|
// we simply store them in labels, to have an easy access to the GT information lateron
|
|
- Image labels = segresult;
|
|
|
|
|
|
+ NICE::Image labels = segresult;
|
|
//just to be sure that we do not have a GT-biased result :)
|
|
//just to be sure that we do not have a GT-biased result :)
|
|
segresult.set(0);
|
|
segresult.set(0);
|
|
|
|
|
|
@@ -445,7 +448,7 @@ void SemSegNovelty::semanticseg ( CachedExample *ce, NICE::Image & segresult, NI
|
|
int xsize, ysize;
|
|
int xsize, ysize;
|
|
ce->getImageSize ( xsize, ysize );
|
|
ce->getImageSize ( xsize, ysize );
|
|
|
|
|
|
- probabilities.reInit( xsize, ysize, cn.getMaxClassno() + 1);
|
|
|
|
|
|
+ probabilities.reInit( xsize, ysize, this->classNames->getMaxClassno() + 1);
|
|
probabilities.setAll ( 0.0 );
|
|
probabilities.setAll ( 0.0 );
|
|
|
|
|
|
NICE::ColorImage img;
|
|
NICE::ColorImage img;
|
|
@@ -1517,3 +1520,353 @@ const Examples * SemSegNovelty::getNovelExamples() const
|
|
{
|
|
{
|
|
return &(this->newTrainExamples);
|
|
return &(this->newTrainExamples);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+///////////////////// INTERFACE PERSISTENT /////////////////////
|
|
|
|
+// interface specific methods for store and restore
|
|
|
|
+///////////////////// INTERFACE PERSISTENT /////////////////////
|
|
|
|
+
|
|
|
|
+void SemSegNovelty::restore ( std::istream & is, int format )
|
|
|
|
+{
|
|
|
|
+ //delete everything we knew so far...
|
|
|
|
+ this->clear();
|
|
|
|
+
|
|
|
|
+ bool b_restoreVerbose ( false );
|
|
|
|
+#ifdef B_RESTOREVERBOSE
|
|
|
|
+ b_restoreVerbose = true;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ if ( is.good() )
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " restore SemSegNovelty" << std::endl;
|
|
|
|
+
|
|
|
|
+ std::string tmp;
|
|
|
|
+ is >> tmp; //class name
|
|
|
|
+
|
|
|
|
+ if ( ! this->isStartTag( tmp, "SemSegNovelty" ) )
|
|
|
|
+ {
|
|
|
|
+ std::cerr << " WARNING - attempt to restore SemSegNovelty, but start flag " << tmp << " does not match! Aborting... " << std::endl;
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (classifier != NULL)
|
|
|
|
+ {
|
|
|
|
+ delete classifier;
|
|
|
|
+ classifier = NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is.precision (numeric_limits<double>::digits10 + 1);
|
|
|
|
+
|
|
|
|
+ bool b_endOfBlock ( false ) ;
|
|
|
|
+
|
|
|
|
+ while ( !b_endOfBlock )
|
|
|
|
+ {
|
|
|
|
+ is >> tmp; // start of block
|
|
|
|
+
|
|
|
|
+ if ( this->isEndTag( tmp, "SemSegNovelty" ) )
|
|
|
|
+ {
|
|
|
|
+ b_endOfBlock = true;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tmp = this->removeStartTag ( tmp );
|
|
|
|
+
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " currently restore section " << tmp << " in SemSegNovelty" << std::endl;
|
|
|
|
+
|
|
|
|
+ if ( tmp.compare("Config") == 0 )
|
|
|
|
+ {
|
|
|
|
+ //TODO think about to put the config fix as first part in store restore... currently, its position is flexible
|
|
|
|
+ // possibly obsolete safety checks
|
|
|
|
+ if ( conf == NULL )
|
|
|
|
+ conf = new Config;
|
|
|
|
+ conf->clear();
|
|
|
|
+
|
|
|
|
+ //we do not want to read until the end of the file
|
|
|
|
+ conf->setIoUntilEndOfFile( false );
|
|
|
|
+ //load every options we determined explicitely
|
|
|
|
+ conf->restore(is, format);
|
|
|
|
+
|
|
|
|
+ // set internal variables, default values, and all those funny things
|
|
|
|
+ this->init();
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else if ( tmp.compare("classifier") == 0 )
|
|
|
|
+ {
|
|
|
|
+ std::string isNull;
|
|
|
|
+ is >> isNull;
|
|
|
|
+
|
|
|
|
+ // check whether we originally used a classifier
|
|
|
|
+ if ( isNull.compare( "NULL" ) == 0 )
|
|
|
|
+ {
|
|
|
|
+ if ( classifier != NULL )
|
|
|
|
+ delete classifier;
|
|
|
|
+ classifier = NULL;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if ( classifier == NULL )
|
|
|
|
+ classifier = new OBJREC::GPHIKClassifierNICE();
|
|
|
|
+
|
|
|
|
+ classifier->restore(is, format);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else if ( tmp.compare("vclassifier") == 0 )
|
|
|
|
+ {
|
|
|
|
+ std::string isNull;
|
|
|
|
+ is >> isNull;
|
|
|
|
+
|
|
|
|
+ // check whether we originally used a vclassifier
|
|
|
|
+ if ( isNull.compare( "NULL" ) == 0 )
|
|
|
|
+ {
|
|
|
|
+ if ( vclassifier != NULL )
|
|
|
|
+ delete vclassifier;
|
|
|
|
+ vclassifier = NULL;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ fthrow ( NICE::Exception, "Restoring of VecClassifiers is not implemented yet!" );
|
|
|
|
+/* if ( vclassifier == NULL )
|
|
|
|
+ vclassifier = new OBJREC::VecClassifier();
|
|
|
|
+
|
|
|
|
+ vclassifier->restore(is, format); */
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else if ( tmp.compare("forbidden_classesTrain") == 0 )
|
|
|
|
+ {
|
|
|
|
+ is >> tmp; // size
|
|
|
|
+ int forbClTrainSize ( 0 );
|
|
|
|
+ is >> forbClTrainSize;
|
|
|
|
+
|
|
|
|
+ forbidden_classesTrain.clear();
|
|
|
|
+
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << "restore forbidden_classesTrain with size: " << forbClTrainSize << std::endl;
|
|
|
|
+
|
|
|
|
+ if ( forbClTrainSize > 0 )
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " restore forbidden_classesTrain" << std::endl;
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < forbClTrainSize; i++)
|
|
|
|
+ {
|
|
|
|
+ int classNo;
|
|
|
|
+ is >> classNo;
|
|
|
|
+ forbidden_classesTrain.insert ( classNo );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " skip restoring forbidden_classesTrain" << std::endl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else if ( tmp.compare("forbidden_classesActiveLearning") == 0 )
|
|
|
|
+ {
|
|
|
|
+ is >> tmp; // size
|
|
|
|
+ int forbClALSize ( 0 );
|
|
|
|
+ is >> forbClALSize;
|
|
|
|
+
|
|
|
|
+ forbidden_classesActiveLearning.clear();
|
|
|
|
+
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << "restore forbidden_classesActiveLearning with size: " << forbClALSize << std::endl;
|
|
|
|
+
|
|
|
|
+ if ( forbClALSize > 0 )
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " restore forbidden_classesActiveLearning" << std::endl;
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < forbClALSize; i++)
|
|
|
|
+ {
|
|
|
|
+ int classNo;
|
|
|
|
+ is >> classNo;
|
|
|
|
+ forbidden_classesActiveLearning.insert ( classNo );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " skip restoring forbidden_classesActiveLearning" << std::endl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else if ( tmp.compare("classesInUse") == 0 )
|
|
|
|
+ {
|
|
|
|
+ is >> tmp; // size
|
|
|
|
+ int clInUseSize ( 0 );
|
|
|
|
+ is >> clInUseSize;
|
|
|
|
+
|
|
|
|
+ classesInUse.clear();
|
|
|
|
+
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << "restore classesInUse with size: " << clInUseSize << std::endl;
|
|
|
|
+
|
|
|
|
+ if ( clInUseSize > 0 )
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " restore classesInUse" << std::endl;
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < clInUseSize; i++)
|
|
|
|
+ {
|
|
|
|
+ int classNo;
|
|
|
|
+ is >> classNo;
|
|
|
|
+ classesInUse.insert ( classNo );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if ( b_restoreVerbose )
|
|
|
|
+ std::cerr << " skip restoring classesInUse" << std::endl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is >> tmp; // end of block
|
|
|
|
+ tmp = this->removeEndTag ( tmp );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ std::cerr << "WARNING -- unexpected SemSegNovelty object -- " << tmp << " -- for restoration... aborting" << std::endl;
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ std::cerr << "SemSegNovelty::restore -- InStream not initialized - restoring not possible!" << std::endl;
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void SemSegNovelty::store ( std::ostream & os, int format ) const
|
|
|
|
+{
|
|
|
|
+ if (os.good())
|
|
|
|
+ {
|
|
|
|
+ // show starting point
|
|
|
|
+ os << this->createStartTag( "SemSegNovelty" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ os.precision (numeric_limits<double>::digits10 + 1);
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "Config" ) << std::endl;
|
|
|
|
+ //we do not want to read until end of file for restoring
|
|
|
|
+ conf->setIoUntilEndOfFile(false);
|
|
|
|
+ conf->store(os,format);
|
|
|
|
+ os << this->createEndTag( "Config" ) << std::endl;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // now, write all variables which might have changed over time compared to initial settings
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "forbidden_classesTrain" ) << std::endl;
|
|
|
|
+ os << "size: " << forbidden_classesTrain.size() << std::endl;
|
|
|
|
+
|
|
|
|
+ for ( std::set< int >::const_iterator itForbClassTrain = forbidden_classesTrain.begin();
|
|
|
|
+ itForbClassTrain != forbidden_classesTrain.end();
|
|
|
|
+ itForbClassTrain++
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ os << *itForbClassTrain << " " << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "forbidden_classesTrain" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "forbidden_classesActiveLearning" ) << std::endl;
|
|
|
|
+ os << "size: " << forbidden_classesActiveLearning.size() << std::endl;
|
|
|
|
+
|
|
|
|
+ for ( std::set< int >::const_iterator itForbClassAL = forbidden_classesActiveLearning.begin();
|
|
|
|
+ itForbClassAL != forbidden_classesActiveLearning.end();
|
|
|
|
+ itForbClassAL++
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ os << *itForbClassAL << " " << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "forbidden_classesActiveLearning" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "classesInUse" ) << std::endl;
|
|
|
|
+ os << "size: " << classesInUse.size() << std::endl;
|
|
|
|
+
|
|
|
|
+ for ( std::set< int >::const_iterator itClassesInUse = classesInUse.begin();
|
|
|
|
+ itClassesInUse != classesInUse.end();
|
|
|
|
+ itClassesInUse++
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ os << *itClassesInUse << " " << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "classesInUse" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "classifier" ) << std::endl;
|
|
|
|
+ if ( this->classifier != NULL )
|
|
|
|
+ {
|
|
|
|
+ os << "NOTNULL" << std::endl;
|
|
|
|
+ classifier->store ( os, format );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ os << "NULL" << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "classifier" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ os << this->createStartTag( "vclassifier" ) << std::endl;
|
|
|
|
+ if ( this->classifier != NULL )
|
|
|
|
+ {
|
|
|
|
+ os << "NOTNULL" << std::endl;
|
|
|
|
+ vclassifier->store ( os, format );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ os << "NULL" << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "vclassifier" ) << std::endl;
|
|
|
|
+
|
|
|
|
+ //TODO classnames?
|
|
|
|
+
|
|
|
|
+ //TODO
|
|
|
|
+/*
|
|
|
|
+ os << this->createStartTag( "queriedRegions" ) << std::endl;
|
|
|
|
+ os << "size: " << queriedRegions.size() << std::endl;
|
|
|
|
+
|
|
|
|
+ for ( std::map<std::string,std::set<int> >::const_iterator itQueriedReg = queriedRegions.begin();
|
|
|
|
+ itQueriedReg != queriedRegions.end();
|
|
|
|
+ itQueriedReg++
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ os << *itForbClassTrain << " " << std::endl;
|
|
|
|
+ }
|
|
|
|
+ os << this->createEndTag( "queriedRegions" ) << std::endl; */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // done
|
|
|
|
+ os << this->createEndTag( "SemSegNovelty" ) << std::endl;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ std::cerr << "OutStream not initialized - storing not possible!" << std::endl;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void SemSegNovelty::clear ()
|
|
|
|
+{
|
|
|
|
+ //TODO
|
|
|
|
+}
|