IVGCVSW-5405 Remove boost::make_iterator_range and boost::to_upper_copy
authorMatthew Sloyan <matthew.sloyan@arm.com>
Tue, 6 Oct 2020 09:45:32 +0000 (10:45 +0100)
committerMatthew Sloyan <matthew.sloyan@arm.com>
Wed, 7 Oct 2020 16:33:25 +0000 (16:33 +0000)
 * Removed from ModelAccuracyTool-Armnn and ImageCSVFileGenerator
 * Fixed formatting in ImageCSVFileGenerator

Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: I09dfca27813582cc48f46d0507680368ed823a9c

tests/ImageCSVFileGenerator/ImageCSVFileGenerator.cpp
tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp

index 5405df9..0138c1c 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <Filesystem.hpp>
 #include <cxxopts/cxxopts.hpp>
-#include <boost/range/iterator_range.hpp>
 
 #include <algorithm>
 #include <fstream>
@@ -147,10 +146,10 @@ public:
                 ("h,help", "Display help messages")
                 ("i,indir",
                     "Directory that .raw files are stored in",
-                 cxxopts::value<std::string>(m_InputDirectory))
+                    cxxopts::value<std::string>(m_InputDirectory))
                 ("o,outfile",
                     "Output CSV file path",
-                 cxxopts::value<std::string>(m_OutputFileName))
+                    cxxopts::value<std::string>(m_OutputFileName))
                 ("l, layer-binding-id",
                     "Input layer binding Id, Defaults to 0",
                     cxxopts::value<std::string>(m_InputBindingId)->default_value("0"));
@@ -209,7 +208,7 @@ int main(int argc, char* argv[])
     const std::string bindingId(cmdline.GetInputBindingId());
 
     std::vector<fs::path> rawFiles;
-    for (auto& entry : boost::make_iterator_range(fs::directory_iterator(rawDirectory), {}))
+    for (auto& entry : fs::directory_iterator(rawDirectory))
     {
         if (entry.path().extension().c_str() == fileFormat)
         {
index edc7e1c..dccf5ff 100644 (file)
@@ -10,7 +10,6 @@
 #include <Filesystem.hpp>
 
 #include <boost/program_options/variables_map.hpp>
-#include <boost/range/iterator_range.hpp>
 #include <map>
 
 using namespace armnn::test;
@@ -391,11 +390,14 @@ map<std::string, std::string> LoadValidationImageFilenamesAndLabels(const string
 {
     // Populate imageFilenames with names of all .JPEG, .PNG images
     std::vector<std::string> imageFilenames;
-    for (const auto& imageEntry :
-         boost::make_iterator_range(fs::directory_iterator(fs::path(imageDirectoryPath))))
+    for (const auto& imageEntry : fs::directory_iterator(fs::path(imageDirectoryPath)))
     {
         fs::path imagePath = imageEntry.path();
-        std::string imageExtension        = boost::to_upper_copy<std::string>(imagePath.extension().string());
+
+        // Get extension and convert to uppercase
+        std::string imageExtension = imagePath.extension().string();
+        std::transform(imageExtension.begin(), imageExtension.end(), imageExtension.begin(), ::toupper);
+
         if (fs::is_regular_file(imagePath) && (imageExtension == ".JPEG" || imageExtension == ".PNG"))
         {
             imageFilenames.push_back(imagePath.filename().string());