From ddb2d98c0d500d1502a4086e3e3fc1ed4c0d46ff Mon Sep 17 00:00:00 2001 From: kartikdutt18 Date: Mon, 1 Jun 2020 15:21:29 +0530 Subject: [PATCH] Style fixes --- augmentation/augmentation.hpp | 2 +- augmentation/augmentation_impl.hpp | 3 +-- dataloader/dataloader_impl.hpp | 16 +++++++++------- tests/augmentation_tests.cpp | 4 +++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/augmentation/augmentation.hpp b/augmentation/augmentation.hpp index 2af8ba6d..22fd8e90 100644 --- a/augmentation/augmentation.hpp +++ b/augmentation/augmentation.hpp @@ -161,4 +161,4 @@ class Augmentation #include "augmentation_impl.hpp" // Include implementation. -#endif \ No newline at end of file +#endif diff --git a/augmentation/augmentation_impl.hpp b/augmentation/augmentation_impl.hpp index 0b48ab74..330c41ca 100644 --- a/augmentation/augmentation_impl.hpp +++ b/augmentation/augmentation_impl.hpp @@ -95,5 +95,4 @@ void Augmentation::InitializeAugmentationMap() // Fill the map here. } - -#endif \ No newline at end of file +#endif diff --git a/dataloader/dataloader_impl.hpp b/dataloader/dataloader_impl.hpp index cf75b299..7b1c2636 100644 --- a/dataloader/dataloader_impl.hpp +++ b/dataloader/dataloader_impl.hpp @@ -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); diff --git a/tests/augmentation_tests.cpp b/tests/augmentation_tests.cpp index 2d10a218..5fc89a4a 100644 --- a/tests/augmentation_tests.cpp +++ b/tests/augmentation_tests.cpp @@ -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);