// clang-format off
general.add_options()
("help,h", "Display available options")
- ("input,i", po::value<std::string>(&_input_filename)->default_value(""), "Input filename")
("dump,d", po::value<std::string>()->default_value(""), "Output filename")
("compare,c", po::value<std::string>()->default_value(""), "filename to be compared with")
("tflite", po::value<std::string>()->required());
vm);
po::notify(vm);
+#if 0 // Enable this when we have mutually conflicting options
{
auto conflicting_options = [&](const std::string &o1, const std::string &o2) {
if ((vm.count(o1) && !vm[o1].defaulted()) && (vm.count(o2) && !vm[o2].defaulted()))
conflicting_options("input", "compare");
}
+#endif
if (vm.count("help"))
{
exit(0);
}
- if (vm.count("input"))
- {
- _input_filename = vm["input"].as<std::string>();
-
- if (!_input_filename.empty())
- {
- if (!boost::filesystem::exists(_input_filename))
- {
- std::cerr << "input image file not found: " << _input_filename << "\n";
- }
- }
- }
-
if (vm.count("dump"))
{
_dump_filename = vm["dump"].as<std::string>();
void print(void);
const std::string &getTFLiteFilename(void) const { return _tflite_filename; }
- const std::string &getInputFilename(void) const { return _input_filename; }
const std::string &getDumpFilename(void) const { return _dump_filename; }
const std::string &getCompareFilename(void) const { return _compare_filename; }
po::options_description _options;
std::string _tflite_filename;
- std::string _input_filename;
std::string _dump_filename;
std::string _compare_filename;
};
TFLiteRun::TensorLoader tensor_loader(*interpreter);
- // Load input from image or dumped tensor file. Two options are exclusive and will be checked
- // from Args.
- if (args.getInputFilename().size() > 0)
- {
- BinImage image(299, 299, 3);
- image.loadImage(args.getInputFilename());
-
- for (const auto &o : interpreter->inputs())
- {
- image.AssignTensor(interpreter->tensor(o));
- }
- }
- else if (!args.getCompareFilename().empty())
+ // Load input from dumped tensor file.
+ if (!args.getCompareFilename().empty())
{
tensor_loader.load(args.getCompareFilename());