private void btnGetResultForTrecEvalColor_Click(object sender, EventArgs e) { // load index for search Dictionary <string, string> pctIndexingDataEval = PCTIndexing.LoadImageIndexStrorageV2(ConfigCommon.PCT_INDEX_STORAGE_EVAL); // read queries Dictionary <string, string> dicQueries = ReadTopicFile(ConfigEvaluation.topicFile_color); foreach (var item in dicQueries) { Console.WriteLine(string.Format("'{0}'", item.Value)); } // search for each query FileStream fs = File.Create(ConfigEvaluation.resultsFile_color); fs.Close(); StreamWriter sw = new StreamWriter(ConfigEvaluation.resultsFile_color); foreach (var query in dicQueries) { // example: 301 Q0 FR940202-2-00150 104 2.129133 STANDARD List <float> listScores; List <string> listFrameName = SearchByColor(pctIndexingDataEval, query.Value); if (listFrameName == null) { sw.Write(query.Key + "\tQ0\tNULL\tNULL\tNULL\tNULL\n"); continue; } HashSet <string> hsDocRetrieval = new HashSet <string>(); for (int i = 0; i < listFrameName.Count; i++) { string docRetrieval = GetDocRetrieval(listFrameName[i]); if (!hsDocRetrieval.Contains(docRetrieval)) { hsDocRetrieval.Add(docRetrieval); } if (hsDocRetrieval.Count == 100) { break; } } for (int i = 0; i < hsDocRetrieval.Count; i++) { //string docRelevanced = GetDocRelevanced(((TextCaption)listTextCaptions[i]).FrameName); string record = string.Format("{0}\tQ0\t{1}\t{2}\t{3}\tRUN_0", query.Key, hsDocRetrieval.ElementAt(i), (i + 1), 0); //Console.WriteLine(record); sw.Write(record + "\n"); } Console.WriteLine(query.Key); } sw.Close(); Console.WriteLine("Finish"); }
void VideoBrowsingForm_Load(object sender, EventArgs e) { textSpotingIndexStorage = new IndexStorage(ConfigCommon.TEXTSPOTTING_INDEX_STORAGE); textSpotingIndexStorage.OpenIndexStore(); textCaptionIndexStorage = new IndexStorage(ConfigCommon.CAPTION_INDEX_STORAGE); textCaptionIndexStorage.OpenIndexStore(); mappingVideoName = FileManager.GetInstance().GetDictionaryVideoName(ConfigCommon.MAPPING_VIDEO_NAME_PATH); mappingFPS = XMLParser.GetFPSDictionary(ConfigCommon.FPS_VIDEO_PATH); pctIndexingData = PCTIndexing.LoadImageIndexStrorageV2(ConfigCommon.PCT_INDEX_STORAGE); }