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

void Impala::Application::Util::DoTrecDropped (  ) 

Definition at line 257 of file mainUtil.cpp.

References Impala::CmdOptions::GetArg(), Impala::Core::Database::RawDataSet::GetFileId(), Impala::CmdOptions::GetInstance(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::CmdOptions::GetNrArg(), Impala::Core::VideoSet::Segmentation::GetNrShotsVideo(), Impala::Core::VideoSet::Segmentation::GetNrVideos(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), and Impala::Persistency::File::ReadStrings().

Referenced by mainUtil().

00258 {
00259     typedef Core::VideoSet::VideoSet VideoSet;
00260     typedef Core::VideoSet::Segmentation Segmentation;
00261 
00262     ILOG_VAR(Impala.Application.Util.DoTrecDropped);
00263     CmdOptions& options = CmdOptions::GetInstance();
00264     if (options.GetNrArg() < 2)
00265     {
00266         ILOG_ERROR("Need at least 2 arguments");
00267         return;
00268     }
00269     String setName = options.GetArg(1);
00270     String dropName = options.GetArg(2);
00271 
00272     VideoSet* vidSet = Core::VideoSet::MakeVideoSet(setName);
00273     SegmentationLocator sLoc(setName, "segmentation", options);
00274     Segmentation* seg = SegmentationRepository().Get(sLoc, vidSet);
00275     ILOG_INFO("nrVideos = " << seg->GetNrVideos());
00276 
00277     Persistency::FileLocator fLoc(vidSet->GetLocator(), dropName);
00278     typedef Persistency::RepositoryInFileSystem FS;
00279     Persistency::File file = FS::GetInstance().GetFile(fLoc, false, false);
00280     std::vector<String> dropped;
00281     file.ReadStrings(dropped);
00282     std::cout << "dropped size = " << dropped.size() << std::endl;
00283 
00284     int nrFiles = 0;
00285     int nrShots = 0;
00286     std::vector<int> ids;
00287     for (int i=0 ; i<dropped.size() ; i++)
00288     {
00289         int fileId = vidSet->GetFileId(dropped[i]);
00290         if (fileId == -1)
00291             continue;
00292         nrFiles++;
00293         nrShots += seg->GetNrShotsVideo(fileId);
00294         ids.push_back(fileId);
00295     }
00296     std::cout << "dropped " << nrFiles << " files and " << nrShots << " shots"
00297               << std::endl;
00298     std::sort(ids.begin(), ids.end());
00299     for (int i=0 ; i<ids.size() ; i++)
00300         std::cout << ids[i] << std::endl;
00301     delete seg;
00302     delete vidSet;
00303 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:27 2011 for ImpalaSrc by  doxygen 1.5.1