TFLiteRun::Args args(argc, argv);
auto model = FlatBufferModel::BuildFromFile(args.getTFLiteFilename().c_str(), &error_reporter);
- BinImage image(299, 299, 3);
+ std::unique_ptr<Interpreter> interpreter;
if (args.getInputFilename().size() > 0)
{
+ BinImage image(299, 299, 3);
image.loadImage(args.getInputFilename());
- }
- std::unique_ptr<Interpreter> interpreter;
+ for (const auto &o : interpreter->inputs())
+ {
+ image.AssignTensor(interpreter->tensor(o));
+ }
+ }
TfLiteStatus status = kTfLiteError;
}
std::cout << "]" << std::endl;
- for (const auto &o : interpreter->inputs())
- {
- image.AssignTensor(interpreter->tensor(o));
- }
-
- t_invoke.measure() << [&status, &interpreter, &image](void) {
+ t_invoke.measure() << [&status, &interpreter](void) {
status = interpreter->Invoke();
assert(status == kTfLiteOk);
};