Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikdutt18 committed Jun 1, 2020
1 parent 02cc8cd commit ddb2d98
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion augmentation/augmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ class Augmentation

#include "augmentation_impl.hpp" // Include implementation.

#endif
#endif
3 changes: 1 addition & 2 deletions augmentation/augmentation_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ void Augmentation<DatasetType>::InitializeAugmentationMap()
// Fill the map here.
}


#endif
#endif
16 changes: 9 additions & 7 deletions dataloader/dataloader_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,18 @@ template<
continue;
}

// Get the size of image to create image info required by mlpack::data::Load function.
boost::property_tree::ptree sizeInformation = annotation.get_child(sizeXMLTag);
size_t imageWidth = std::stoi(sizeInformation.get_child("width").data());
size_t imageHeight = std::stoi(sizeInformation.get_child("height").data());
size_t imageDepth = std::stoi(sizeInformation.get_child("depth").data());
// Get the size of image to create image info required
// by mlpack::data::Load function.
boost::property_tree::ptree sizeInfo = annotation.get_child(sizeXMLTag);
size_t imageWidth = std::stoi(sizeInfo.get_child("width").data());
size_t imageHeight = std::stoi(sizeInfo.get_child("height").data());
size_t imageDepth = std::stoi(sizeInfo.get_child("depth").data());
mlpack::data::ImageInfo imageInfo(imageWidth, imageHeight, imageDepth);

// Load the image.
// The image loaded here will be in column format i.e. Output will be matrix with the
// following shape {1, cols * rows * slices} in column major format.
// The image loaded here will be in column format i.e. Output will
// be matrix with the following shape {1, cols * rows * slices} in
// column major format.
DatasetX image;
mlpack::data::Load(pathToImages + imgName, image, imageInfo);

Expand Down
4 changes: 3 additions & 1 deletion tests/augmentation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ BOOST_AUTO_TEST_SUITE(AugmentationTest);

BOOST_AUTO_TEST_CASE(REGEXTest)
{
std::string s = " resize = { 19, 112 }, resize : 133,442, resize = [12 213]";
// Some accepted formats.
std::string s = " resize = { 19, 112 }, \
resize : 133,442, resize = [12 213]";
boost::regex expr{"[0-9]+"};
boost::smatch what;
boost::sregex_token_iterator iter(s.begin(), s.end(), expr, 0);
Expand Down

0 comments on commit ddb2d98

Please sign in to comment.