Rolling 20211230

This commit is contained in:
jomjol
2021-12-30 11:02:20 +01:00
parent 58a0297915
commit 957138960a
24 changed files with 2204 additions and 134 deletions

View File

@@ -236,14 +236,13 @@ bool CTfLiteClass::LoadModel(std::string _fn){
this->error_reporter = new tflite::MicroErrorReporter;
#endif
unsigned char *rd;
rd = ReadFileToCharArray(_fn.c_str());
modelload = ReadFileToCharArray(_fn.c_str());
if (rd == NULL)
if (modelload == NULL)
return false;
this->model = tflite::GetModel(rd);
free(rd);
model = tflite::GetModel(modelload);
// free(rd);
TFLITE_MINIMAL_CHECK(model != nullptr);
return true;
@@ -266,6 +265,8 @@ CTfLiteClass::~CTfLiteClass()
delete this->tensor_arena;
delete this->interpreter;
delete this->error_reporter;
if (modelload)
free(modelload);
}