Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void Impala::Application::ActiveLearnEngine::SubmitRequest (  )  [inline]

Definition at line 138 of file ActiveLearnEngine.h.

References AddRandomNegatives(), Impala::Util::Database::GetFilePath(), GetID(), Impala::Util::Database::GetIOBuffer(), Impala::Core::Table::AnnotationTable::GetNrNegative(), Impala::Core::Table::AnnotationTable::GetNrPositive(), ILOG_DEBUG, ILOG_INFO, ILOG_WARN, mALDatabase, mAnnotations, mAutoNegatives, mAutoNegativesNumber, mInfoSent, Impala::QUID_CLASS_FRAME, Impala::QuidClassToString(), and Impala::Util::Write().

00139     {
00140         if (mInfoSent)
00141             return;
00142 
00143         if (mAnnotations->GetNrPositive() == 0)
00144         {
00145             ILOG_WARN("No positive examples, ALE request not submitted.");
00146             return;
00147         }
00148 
00149         if (mAnnotations->GetNrNegative() == 0)
00150         {
00151             if (mAutoNegatives) {
00152                 ILOG_INFO("No negative examples given, selecting random subset...");
00153                 AddRandomNegatives(mAutoNegativesNumber);
00154             } else {
00155                 ILOG_WARN("No negative examples and random selection disabled, ALE request not submitted.");
00156                 return;
00157             }
00158         }
00159 
00160         ILOG_DEBUG("Using table with " << mAnnotations->GetNrPositive() << " positive shots and " << mAnnotations->GetNrNegative() << " negative shots.");
00161 
00162         String dir = "Annotations/" + QuidClassToString(QUID_CLASS_FRAME) + "/" + "conceptsActiveLearn.txt";        
00163         String filename = mALDatabase->GetFilePath(dir, GetID() + ".tab", true, false);
00164 
00165         ILOG_DEBUG("Writing to " << filename << "...");
00166 
00167         Core::Table::Write(mAnnotations, filename, mALDatabase, true);
00168 
00169         ILOG_DEBUG("Signalling active learning engine...");
00170         
00171         String startlearnfile = mALDatabase->GetFilePath(dir, "startlearner.txt", true, false);
00172 
00173         Util::IOBuffer *slf = mALDatabase->GetIOBuffer(
00174                                 startlearnfile, false, false, "tmp");
00175         if (!slf)
00176         {
00177             ILOG_WARN("No startlearnfile, ALE request not submitted.");
00178             return;
00179         }
00180         slf->IOBuffer::Puts(GetID());
00181         delete slf;
00182 
00183         ILOG_DEBUG("Signal sent.");
00184         mInfoSent = true;
00185     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:14:38 2011 for ImpalaSrc by  doxygen 1.5.1