Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeShewill-CV committed Nov 2, 2023
1 parent fc5ad2b commit 716fa94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/models/classification/dinov2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public:
private:
std::string _m_model_file_path;
// mnn interpreter
std::unique_ptr <MNN::Interpreter> _m_net = nullptr;
MNN::Interpreter* _m_net = nullptr;
// mnn session
MNN::Session* _m_session = nullptr;
// mnn session config
Expand Down Expand Up @@ -226,8 +226,7 @@ StatusCode Dinov2<INPUT, OUTPUT>::Impl::init(const decltype(toml::parse(""))& co
return StatusCode::MODEL_INIT_FAILED;
}

_m_net = std::unique_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(_m_model_file_path.c_str()));

_m_net = MNN::Interpreter::createFromFile(_m_model_file_path.c_str());
if (_m_net == nullptr) {
LOG(ERROR) << "Create Interpreter failed, model file path: " << _m_model_file_path;
_m_successfully_initialized = false;
Expand Down
4 changes: 2 additions & 2 deletions src/models/classification/mobilenetv2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public:
private:
std::string _m_model_file_path;
// MNN Net
std::unique_ptr <MNN::Interpreter> _m_net = nullptr;
MNN::Interpreter* _m_net = nullptr;
// MNN Session
MNN::Session* _m_session = nullptr;
// MNN Session Config
Expand Down Expand Up @@ -226,7 +226,7 @@ StatusCode MobileNetv2<INPUT, OUTPUT>::Impl::init(const decltype(toml::parse("")
return StatusCode::MODEL_INIT_FAILED;
}

_m_net = std::unique_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(_m_model_file_path.c_str()));
_m_net = MNN::Interpreter::createFromFile(_m_model_file_path.c_str());
if (_m_net == nullptr) {
LOG(ERROR) << "Create Interpreter failed, model file path: " << _m_model_file_path;
_m_successfully_initialized = false;
Expand Down
5 changes: 2 additions & 3 deletions src/models/classification/resnet.inl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public:
private:
std::string _m_model_file_path;
// MNN Net
std::unique_ptr <MNN::Interpreter> _m_net = nullptr;
MNN::Interpreter* _m_net = nullptr;
// MNN session
MNN::Session* _m_session = nullptr;
// MNN session
Expand Down Expand Up @@ -226,8 +226,7 @@ StatusCode ResNet<INPUT, OUTPUT>::Impl::init(const decltype(toml::parse(""))& co
return StatusCode::MODEL_INIT_FAILED;
}

_m_net = std::unique_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(_m_model_file_path.c_str()));

_m_net = MNN::Interpreter::createFromFile(_m_model_file_path.c_str());
if (_m_net == nullptr) {
LOG(ERROR) << "Create Interpreter failed, model file path: " << _m_model_file_path;
_m_successfully_initialized = false;
Expand Down

0 comments on commit 716fa94

Please sign in to comment.