TensorFlow Lite provides programming APIs in C++, Java and Python, with experimental bindings for several other languages (C, Swift, Objective-C).
TensorFlow Lite支持的API语言非常多。
C++ 加载Model
Tensorflow Lite多数情况下都是namespace tflite为命名空间的,
tflite::FlatBufferModel类封装了加载Model。
class FlatBufferModel {
public:
// Builds a model based on a file.
// Caller retains ownership of `error_reporter` and must ensure its lifetime
// is longer than the FlatBufferModel instance.
// Returns a nullptr in case of failure.
static std::unique_ptr<FlatBufferModel> BuildFromFile(
const char* filename,
ErrorReporter* error_reporter = DefaultErrorReporter());
// Builds a model based on a pre-loaded flatbuffer.
// Caller retains ownership of the buffer and should keep it alive until
// the returned object is destroyed. Caller also retains ownership of
// `er