Пример #1
0
// Gets information about available chunks.
ChunkDescriptions HTKDataDeserializer::GetChunkDescriptions()
{
    ChunkDescriptions chunks;
    chunks.reserve(m_chunks.size());

    for (size_t i = 0; i < m_chunks.size(); ++i)
    {
        auto cd = make_shared<ChunkDescription>();
        cd->m_id = i;
        cd->m_numberOfSamples = m_chunks[i].GetTotalFrames();
        cd->m_numberOfSequences = m_chunks[i].GetTotalFrames();
        chunks.push_back(cd);
    }
    return chunks;
}
Пример #2
0
 ChunkDescriptions Base64ImageDeserializer::GetChunkDescriptions()
 {
     const auto& index = m_indexer->GetIndex();
     // In case of multi crop the deserializer provides the same sequence NumMultiViewCopies times.
     size_t sequencesPerInitialSequence = m_multiViewCrop ? ImageDeserializerBase::NumMultiViewCopies : 1;
     ChunkDescriptions result;
     result.reserve(index.m_chunks.size() * sequencesPerInitialSequence);
     for (auto const& chunk : index.m_chunks)
     {
         auto c = std::make_shared<ChunkDescription>();
         c->m_id = chunk.m_id;
         assert(chunk.m_numberOfSamples == chunk.m_numberOfSequences);
         c->m_numberOfSamples = c->m_numberOfSequences = chunk.m_numberOfSequences * sequencesPerInitialSequence;
         result.push_back(c);
     }
     return result;
 }