diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2019-04-12 15:17:02 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2019-04-12 15:17:02 +0100 |
commit | 2b03d64da2a3a39d069a7a2366f14439afb1ad39 (patch) | |
tree | 7a6ed87ad3c9feeea779fa4e241d6f589cb0dc56 /src/armnnQuantizer/CommandLineProcessor.cpp | |
parent | 7b4886faccb52af9afe7fdeffcbae87e7fbc1484 (diff) | |
download | armnn-2b03d64da2a3a39d069a7a2366f14439afb1ad39.tar.gz |
IVGCVSW-2955 Update the Quantizer Tool to take an additional parameter for the user to specify a CSV file
Change-Id: Id56e09f147cca5c1301ec1b6bac656cd50bfd583
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Diffstat (limited to 'src/armnnQuantizer/CommandLineProcessor.cpp')
-rw-r--r-- | src/armnnQuantizer/CommandLineProcessor.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/armnnQuantizer/CommandLineProcessor.cpp b/src/armnnQuantizer/CommandLineProcessor.cpp index 1a10d38cdf..a7baa5cac4 100644 --- a/src/armnnQuantizer/CommandLineProcessor.cpp +++ b/src/armnnQuantizer/CommandLineProcessor.cpp @@ -42,17 +42,17 @@ bool ValidateOutputDirectory(std::string& dir) return true; } -bool ValidateInputFile(const std::string& inputFileName) +bool ValidateProvidedFile(const std::string& inputFileName) { if (!boost::filesystem::exists(inputFileName)) { - std::cerr << "Input file [" << inputFileName << "] does not exist" << std::endl; + std::cerr << "Provided file [" << inputFileName << "] does not exist" << std::endl; return false; } if (boost::filesystem::is_directory(inputFileName)) { - std::cerr << "Given input file [" << inputFileName << "] is a directory" << std::endl; + std::cerr << "Given file [" << inputFileName << "] is a directory" << std::endl; return false; } @@ -70,6 +70,8 @@ bool CommandLineProcessor::ProcessCommandLine(int argc, char* argv[]) ("help,h", "Display help messages") ("infile,f", po::value<std::string>(&m_InputFileName)->required(), "Input file containing float 32 ArmNN Input Graph") + ("csvfile,c", po::value<std::string>(&m_CsvFileName)->default_value(""), + "CSV file containing paths for RAW input tensors") ("outdir,d", po::value<std::string>(&m_OutputDirectory)->required(), "Directory that output file will be written to") ("outfile,o", po::value<std::string>(&m_OutputFileName)->required(), "Output file name"); @@ -101,11 +103,24 @@ bool CommandLineProcessor::ProcessCommandLine(int argc, char* argv[]) return false; } - if (!armnnQuantizer::ValidateInputFile(m_InputFileName)) + if (!armnnQuantizer::ValidateProvidedFile(m_InputFileName)) { return false; } + if (m_CsvFileName != "") + { + if (!armnnQuantizer::ValidateProvidedFile(m_CsvFileName)) + { + return false; + } + else + { + boost::filesystem::path csvFilePath(m_CsvFileName); + m_CsvFileDirectory = csvFilePath.parent_path().c_str(); + } + } + if (!armnnQuantizer::ValidateOutputDirectory(m_OutputDirectory)) { return false; |