#ifndef inferencer_hpp #define inferencer_hpp #ifdef __ANDROID__ #include "tensorflow/lite/model_builder.h" #include "tensorflow/lite/kernels/register.h" #else #include #endif #include class TfliteWrapper { private: #ifdef __ANDROID__ std::unique_ptr model; std::unique_ptr interpreter; TfLiteDelegate* delegate; #else TfLiteModel* model; TfLiteDelegate* delegate; TfLiteInterpreter *interpreter; #endif public: TfliteWrapper(const char *modelPath); void Invoke(const void* input_data, size_t input_data_size, void* output_data, size_t output_data_size); void getInputShape(uint32_t *shape, size_t size); ~TfliteWrapper(); }; #endif /* inferencer_hpp */