End of a "normal" walk.
Reimplemented from Impala::Core::VideoSet::Listener. Definition at line 155 of file IndexAnnotation.h. References Impala::FileNameBase(), Impala::Core::Table::AnnotationTableSet::GetLabel(), Impala::Core::VideoSet::Keyframes::GetNrKeyframes(), Impala::Core::VideoSet::Segmentation::GetNrShots(), ILOG_INFO, mAnnoExtra, mAnnoFrame, mAnnoShot, mConceptExtra, mConceptSet, mKeyframes, mQuidExtra, mSegmentation, mTotalNrAnno, mTotalNrAnnoPos, mTotalNrFrames, mTotalNrFramesPos, mTotalNrSingleFrame, mTotalNrSingleFramePos, Impala::Core::Table::AnnotationTableSet::SaveTables(), Impala::Core::Table::AnnotationTableSet::Size(), Impala::Core::Table::Sort(), and Impala::Core::Table::Write(). 00156 { 00157 Persistency::AnnotationTableSetLocator loc(vs->GetLocator(), 0, 00158 mConceptSet); 00159 for (int c=0 ; c<mAnnoShot->Size() ; c++) 00160 { 00161 String concept = mAnnoShot->GetLabel(c); 00162 int nrShot = mTotalNrAnno[c] - mTotalNrSingleFrame[c]; 00163 double avg = (double) mTotalNrFrames[c] / nrShot; 00164 if (nrShot == 0) 00165 avg = 1; 00166 ILOG_INFO("Indexed " << mTotalNrAnno[c] << " annotations for " 00167 << concept); 00168 ILOG_INFO("total of " << mTotalNrSingleFrame[c] << " frames and " 00169 << nrShot << " shots with avg length of " << avg); 00170 nrShot = mTotalNrAnnoPos[c] - mTotalNrSingleFramePos[c]; 00171 avg = (double) mTotalNrFramesPos[c] / nrShot; 00172 if (nrShot == 0) 00173 avg = 1; 00174 ILOG_INFO("postives: total of " << mTotalNrSingleFramePos[c] << 00175 " frames and " << nrShot << " shots with avg length of " 00176 << avg); 00177 } 00178 if (mSegmentation) 00179 { 00180 ILOG_INFO("Number of shots " << mSegmentation->GetNrShots()); 00181 ILOG_INFO("Saving shot annotations"); 00182 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00183 mAnnoShot->SaveTables(vs, mConceptSet, true); 00184 #else // REPOSITORY_USED 00185 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoShot); 00186 #endif // REPOSITORY_USED 00187 } 00188 if (mKeyframes) 00189 { 00190 ILOG_INFO("Number of keyframes " << mKeyframes->GetNrKeyframes()); 00191 ILOG_INFO("Saving keyframe annotations"); 00192 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00193 mAnnoFrame->SaveTables(vs, mConceptSet, true); 00194 #else // REPOSITORY_USED 00195 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoFrame); 00196 #endif // REPOSITORY_USED 00197 } 00198 if (mAnnoExtra) 00199 { 00200 ILOG_INFO("Saving extra annotations"); 00201 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00202 mAnnoExtra->SaveTables(vs, mConceptExtra, true); 00203 #else // REPOSITORY_USED 00204 loc.SetConceptSet(mConceptExtra); 00205 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoExtra); 00206 #endif // REPOSITORY_USED 00207 ILOG_INFO("Sorting and saving quids"); 00208 Table::Sort(mQuidExtra, 1, true); 00209 String qName = FileNameBase(mConceptExtra) + "_quids.tab"; 00210 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00211 String fName = vs->GetFilePathAnnotation(qName, true, false); 00212 if (!fName.empty()) 00213 Table::Write(mQuidExtra, fName, vs->GetDatabase(), true); 00214 #else // REPOSITORY_USED 00215 Persistency::QuidTableLocator qLoc(vs->GetLocator(), "Annotations", 00216 qName); 00217 Persistency::QuidTableRepository().Add(qLoc, mQuidExtra); 00218 #endif // REPOSITORY_USED 00219 } 00220 }
Here is the call graph for this function:
|