diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index b6c353b..cbc0769 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -470,7 +470,7 @@ Waifu2x::eWaifu2xError Waifu2x::ConstractNet(boost::shared_ptr caffe::NetParameter param; if (isModelExist && isModelBinExist && caffe::ReadProtoFromBinaryFile(modelbin_path, ¶m)) { - const auto ret = SetParameter(param); + const auto ret = SetParameter(param, process); if (ret != eWaifu2xError_OK) return ret; @@ -481,7 +481,7 @@ Waifu2x::eWaifu2xError Waifu2x::ConstractNet(boost::shared_ptr } else { - const auto ret = LoadParameterFromJson(net, model_path, param_path); + const auto ret = LoadParameterFromJson(net, model_path, param_path, process); if (ret != eWaifu2xError_OK) return ret; } @@ -489,7 +489,7 @@ Waifu2x::eWaifu2xError Waifu2x::ConstractNet(boost::shared_ptr return eWaifu2xError_OK; } -Waifu2x::eWaifu2xError Waifu2x::SetParameter(caffe::NetParameter ¶m) const +Waifu2x::eWaifu2xError Waifu2x::SetParameter(caffe::NetParameter ¶m, const std::string &process) const { param.mutable_state()->set_phase(caffe::TEST); @@ -527,7 +527,7 @@ Waifu2x::eWaifu2xError Waifu2x::SetParameter(caffe::NetParameter ¶m) const return eWaifu2xError_OK; } -Waifu2x::eWaifu2xError Waifu2x::LoadParameterFromJson(boost::shared_ptr> &net, const std::string &model_path, const std::string ¶m_path) +Waifu2x::eWaifu2xError Waifu2x::LoadParameterFromJson(boost::shared_ptr> &net, const std::string &model_path, const std::string ¶m_path, const std::string &process) { const std::string caffemodel_path = param_path + ".caffemodel"; const std::string modelbin_path = model_path + ".protobin"; @@ -538,7 +538,7 @@ Waifu2x::eWaifu2xError Waifu2x::LoadParameterFromJson(boost::shared_ptr &zoom_size); eWaifu2xError CreateZoomColorImage(const cv::Mat &float_image, const cv::Size_ &zoom_size, std::vector &cubic_planes); eWaifu2xError ConstractNet(boost::shared_ptr> &net, const std::string &model_path, const std::string ¶m_path, const std::string &process); - eWaifu2xError LoadParameterFromJson(boost::shared_ptr> &net, const std::string &model_path, const std::string ¶m_path); - eWaifu2xError SetParameter(caffe::NetParameter ¶m) const; + eWaifu2xError LoadParameterFromJson(boost::shared_ptr> &net, const std::string &model_path, const std::string ¶m_path, const std::string &process); + eWaifu2xError SetParameter(caffe::NetParameter ¶m, const std::string &process) const; eWaifu2xError ReconstructImage(boost::shared_ptr> net, cv::Mat &im); eWaifu2xError WriteMat(const cv::Mat &im, const std::string &output_file);