diff --git a/dataloader/dataloader.hpp b/dataloader/dataloader.hpp index b6944063..5e707ab4 100644 --- a/dataloader/dataloader.hpp +++ b/dataloader/dataloader.hpp @@ -160,7 +160,8 @@ class DataLoader const std::vector& classes, const bool absolutePath = false, const std::string& baseXMLTag = "annotation", - const std::string& imageNameXMLTag = "filename", + const std::string& imageNameXMLTag = + "filename", const std::string& objectXMLTag = "object", const std::string& bndboxXMLTag = "bndbox", const std::string& classNameXMLTag = "name", diff --git a/dataloader/dataloader_impl.hpp b/dataloader/dataloader_impl.hpp index 79fa8d0c..003e3eeb 100644 --- a/dataloader/dataloader_impl.hpp +++ b/dataloader/dataloader_impl.hpp @@ -202,19 +202,22 @@ template< { arma::uvec predictions(5); - // Iterate over property of the object to get class label and bounding box - // coordinates. + // Iterate over property of the object to get class label and + // bounding box coordinates. if (classMap.count(object.second.get_child(classNameXMLTag).data())) { - predictions(indexMap[classNameXMLTag]) = classMap[object.second.get_child(classNameXMLTag).data()]; - boost::property_tree::ptree const &boundingBox = object.second.get_child(bndboxXMLTag); + predictions(indexMap[classNameXMLTag]) = classMap[ + object.second.get_child(classNameXMLTag).data()]; + boost::property_tree::ptree const &boundingBox = + object.second.get_child(bndboxXMLTag); - BOOST_FOREACH (boost::property_tree::ptree::value_type const& coordinate, - boundingBox) + BOOST_FOREACH (boost::property_tree::ptree::value_type + const& coordinate, boundingBox) { if (indexMap.count(coordinate.first)) { - predictions(indexMap[coordinate.first]) = std::stoi(coordinate.second.data()); + predictions(indexMap[coordinate.first]) = + std::stoi(coordinate.second.data()); } } // predictions.print(); diff --git a/tests/dataloader_tests.cpp b/tests/dataloader_tests.cpp index 2890740b..01859f45 100644 --- a/tests/dataloader_tests.cpp +++ b/tests/dataloader_tests.cpp @@ -75,7 +75,8 @@ BOOST_AUTO_TEST_CASE(MNISTDataLoaderTest) BOOST_AUTO_TEST_CASE(ObjectDetectionDataLoader) { DataLoader<> dataloader; - dataloader.LoadObjectDetectionDataset("./../data/annotations/", "./../data", {"person", "foot", "aeroplane", "head", "hand"}); + dataloader.LoadObjectDetectionDataset("./../data/annotations/", "./../data", + {"person", "foot", "aeroplane", "head", "hand"}); } BOOST_AUTO_TEST_SUITE_END();