Skip to content

Commit

Permalink
Addressing CR
Browse files Browse the repository at this point in the history
  • Loading branch information
eldakms committed May 18, 2016
1 parent 74bc850 commit 60424db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Readers/ImageReader/ImageDataDeserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,12 @@ void ImageDataDeserializer::CreateSequenceDescriptions(CorpusDescriptorPtr corpu
if (!std::getline(ss, sequenceKey, '\t') || !std::getline(ss, imagePath, '\t') || !std::getline(ss, classId, '\t'))
{
// In case when the sequence key is not specified we set it to the line number inside the mapping file.
// Assume that only image path and class label is given (old format).
classId = imagePath;
imagePath = sequenceKey;
sequenceKey = std::to_string(lineIndex);
ss.clear();
ss.str(line);
if (!std::getline(ss, imagePath, '\t') || !std::getline(ss, classId, '\t'))

if (classId.empty() || imagePath.empty())
RuntimeError("Invalid map file format, must contain 2 or 3 tab-delimited columns, line %" PRIu64 " in file %s.", lineIndex, mapPath.c_str());
}

Expand Down

0 comments on commit 60424db

Please sign in to comment.