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

FikSvm* Impala::Persistency::FikSvmRepositoryInFile::Get ( const ModelLocator loc  )  [inline]

Definition at line 37 of file FikSvmRepositoryInFile.h.

References Impala::Persistency::ModelLocator::GetConcept(), GetDir(), Impala::Util::PropertySet::GetDouble(), Impala::Persistency::RepositoryInFileSystem::GetFile(), Impala::Util::PropertySet::GetInt(), Impala::Core::Training::FikSvm::GetNrFeatures(), Impala::Persistency::File::GetReadBuffer(), Impala::Core::Training::FikSvm::ImportSvm(), Impala::MakeString(), Impala::Util::Read(), Impala::Core::Array::ReadRaw(), RepFS(), and Impala::Persistency::File::Valid().

00038     {
00039         String dir = GetDir(loc, false);
00040         File file = RepFS().GetFile(loc, dir, loc.GetConcept() + ".props",
00041                                     false, false);
00042         if (!file.Valid())
00043             return 0;
00044 
00045         Util::PropertySet ps;
00046         Read(&ps, file);
00047 
00048         File featFile = RepFS().GetFile(loc, dir, loc.GetConcept() + ".features",
00049                                         false, false);
00050         WeightedFeatureList features;
00051         Read(&features, featFile);
00052 
00053         FikSvm* svm = new FikSvm(features, ps.GetInt("nrBins"),
00054                                  ps.GetInt("nrSV"), ps.GetDouble("rho"),
00055                                  ps.GetDouble("probA"), ps.GetDouble("probB"),
00056                                  ps.GetInt("probIndex"));
00057 
00058         for (int i=0 ; i<svm->GetNrFeatures() ; i++)
00059         {
00060             File rawFile = RepFS().GetFile(loc, dir, MakeString(i) + ".raw",
00061                                            false, false);
00062             Util::IOBuffer* buf = rawFile.GetReadBuffer();
00063             Core::Matrix::Mat* h = 0;
00064             ReadRaw(h, buf);
00065             Core::Matrix::Mat* a = 0;
00066             ReadRaw(a, buf);
00067             Core::Matrix::Mat* b = 0;
00068             ReadRaw(b, buf);
00069             svm->ImportSvm(h, a, b);
00070             delete b;
00071             delete a;
00072             delete h;
00073             delete buf;
00074         }
00075         return svm;
00076     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:22:50 2011 for ImpalaSrc by  doxygen 1.5.1