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

int Impala::Samples::MonetTest::mainMonetTest ( int  argc,
char *  argv[] 
)

Definition at line 1458 of file mainMonetTest.cpp.

References Impala::CmdOptions::AddOption(), Impala::atol(), DoCheckAnnotations(), DoCheckFeatures(), DoCheckFrameArchive(), DoCheckKeyframes(), DoCheckKeywords(), DoCheckSegmentation(), DoCheckVideoFiles(), DoInsertAnnotations(), DoInsertFeatures(), DoInsertFrameArchive(), DoInsertKeyframes(), DoInsertKeywords(), DoInsertModels(), DoInsertModelSets(), DoInsertSegmentation(), DoInsertVideoFiles(), DoInsertVideoSets(), DoSample(), DoSimilarities(), Impala::CmdOptions::GetArg(), Impala::ILogErrors::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetString(), Impala::ILogErrors::GetTotalNrErrors(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::CmdOptions::Initialise(), Impala::CmdOptions::ParseArgs(), and Impala::Timer::SplitTimeStr().

Referenced by main().

01459 {
01460     CmdOptions& options = CmdOptions::GetInstance();
01461     options.Initialise(false, false, true);
01462     options.AddOption(0, "saveQueries", "log_dir", "");
01463     options.AddOption(0, "startFile", "idx", "0");
01464     options.AddOption(0, "numberFiles", "nr", "-1");
01465     options.AddOption(0, "startConcept", "idx", "0");
01466     options.AddOption(0, "numberConcepts", "nr", "-1");
01467     options.AddOption(0, "startScore", "idx", "0");
01468     options.AddOption(0, "numberScores", "nr", "-1");
01469     options.AddOption(0, "", "nr", "-1");
01470     String usageStr = "cmd = \n\n";
01471     usageStr += "  sample host port db\n";
01472     usageStr += "  insertvideosets host port db\n";
01473     usageStr += "  insertvideofiles host port db videoSet.txt\n";
01474     usageStr += "  checkvideofiles host port db videoSet.txt\n";
01475     usageStr += "  insertsegmentation host port db videoSet.txt\n";
01476     usageStr += "  checksegmentation host port db videoSet.txt\n";
01477     usageStr += "  insertkeyframes host port db videoSet.txt\n";
01478     usageStr += "  checkkeyframes host port db videoSet.txt\n";
01479     usageStr += "  insertframearchive host port db videoSet.txt\n";
01480     usageStr += "  checkframearchive host port db videoSet.txt\n";
01481     usageStr += "  insertkeywords host port db videoSet.txt concepts.txt\n";
01482     usageStr += "  checkkeywords host port db videoSet.txt concepts.txt\n";
01483     usageStr += "  insertannotations host port db videoSet.txt concepts.txt quidClass\n";
01484     usageStr += "  checkannotations host port db videoSet.txt concepts.txt quidClass\n";
01485     usageStr += "  insertfeatures host port db videoSet.txt featureDef\n";
01486     usageStr += "  checkfeatures host port db videoSet.txt featureDef\n";
01487     usageStr += "  insertmodels host port db videoSet.txt concepts.txt model featureDef\n";
01488     usageStr += "  insertmodelsets host port db videoSet.txt concepts.txt model modelSet featureDef[s]\n";
01489     usageStr += "  insertsimilarities host port db videoSet.txt concepts.txt model feature\n";
01490     usageStr += "  checksimilarities host port db videoSet.txt concepts.txt model feature\n";
01491     if (! options.ParseArgs(argc, argv, usageStr, 4))
01492         return 1;
01493 
01494     ILOG_VAR(Impala.Samples.mainMonetTest);
01495 
01496     String cmd = options.GetArg(0);
01497     String host = options.GetArg(1);
01498     int port = atol(options.GetArg(2));
01499     String dbName = options.GetArg(3);
01500     ILOG_INFO("Connecting to " << dbName << " on " << host << ":" << port);
01501     Link::Monet::Connection conn(host, port, dbName);
01502     if (!conn.Valid())
01503         return 1;
01504     conn.SetSaveQueries(options.GetString("saveQueries"));
01505 
01506     Timer timer;
01507     if (cmd == "sample")
01508         DoSample(&conn);
01509     else if (cmd == "insertvideosets")
01510         DoInsertVideoSets(&conn);
01511     else if (cmd == "insertvideofiles")
01512         DoInsertVideoFiles(&conn);
01513     else if (cmd == "checkvideofiles")
01514         DoCheckVideoFiles(&conn);
01515     else if (cmd == "insertsegmentation")
01516         DoInsertSegmentation(&conn);
01517     else if (cmd == "checksegmentation")
01518         DoCheckSegmentation(&conn);
01519     else if (cmd == "insertkeyframes")
01520         DoInsertKeyframes(&conn);
01521     else if (cmd == "checkkeyframes")
01522         DoCheckKeyframes(&conn);
01523     else if (cmd == "insertframearchive")
01524         DoInsertFrameArchive(&conn);
01525     else if (cmd == "checkframearchive")
01526         DoCheckFrameArchive(&conn);
01527     else if (cmd == "insertkeywords")
01528         DoInsertKeywords(&conn);
01529     else if (cmd == "checkkeywords")
01530         DoCheckKeywords(&conn);
01531     else if (cmd == "insertannotations")
01532         DoInsertAnnotations(&conn);
01533     else if (cmd == "checkannotations")
01534         DoCheckAnnotations(&conn);
01535     else if (cmd == "insertfeatures")
01536         DoInsertFeatures(&conn);
01537     else if (cmd == "checkfeatures")
01538         DoCheckFeatures(&conn);
01539     else if (cmd == "insertmodels")
01540         DoInsertModels(&conn);
01541     else if (cmd == "insertmodelsets")
01542         DoInsertModelSets(&conn);
01543     else if (cmd == "insertsimilarities")
01544         DoSimilarities(&conn, true);
01545     else if (cmd == "checksimilarities")
01546         DoSimilarities(&conn, false);
01547     else ILOG_ERROR("Unknown cmd : " << cmd);
01548 
01549     ILOG_INFO("Did command in " << timer.SplitTimeStr());
01550     int nrError = ILogErrors::GetInstance().GetTotalNrErrors();
01551     ILOG_INFO("NrError = " << nrError);
01552     return nrError;
01553 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:38:35 2010 for ImpalaSrc by  doxygen 1.5.1