From b0135bdb04c2425ed5e7f4426ef04d740e42a5e7 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Tue, 6 Aug 2024 19:09:45 +0700 Subject: [PATCH] Create model.h --- .../pi_network/dapi/ai/ml/tensorflow/model.h | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 blockchain_integration/pi_network/dapi/ai/ml/tensorflow/model.h diff --git a/blockchain_integration/pi_network/dapi/ai/ml/tensorflow/model.h b/blockchain_integration/pi_network/dapi/ai/ml/tensorflow/model.h new file mode 100644 index 000000000..1d241fac1 --- /dev/null +++ b/blockchain_integration/pi_network/dapi/ai/ml/tensorflow/model.h @@ -0,0 +1,35 @@ +#ifndef MODEL_H +#define MODEL_H + +#include +#include +#include +#include +#include + +class Model { +public: + Model(const std::string& model_path); + ~Model(); + + // Load the model from a file + void load(); + + // Run the model on input data + std::vector run(const std::vector& input); + + // Get the model's input shape + std::vector get_input_shape() const; + + // Get the model's output shape + std::vector get_output_shape() const; + +private: + std::string model_path_; + tensorflow::Session* session_; + tensorflow::GraphDef graph_def_; + std::vector inputs_; + std::vector outputs_; +}; + +#endif // MODEL_H