Skip to content

Commit

Permalink
Style Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikdutt18 committed May 29, 2020
1 parent 8e91ab8 commit 302375c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion dataloader/dataloader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ class DataLoader
const std::vector<std::string>& 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",
Expand Down
17 changes: 10 additions & 7 deletions dataloader/dataloader_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tests/dataloader_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 302375c

Please sign in to comment.