From c13d6c1a8beddcc341a5211777b7b32e0acb955b Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 27 Dec 2015 04:14:34 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=8A=E3=83=AA=E3=81=AE?= =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AB=E3=80=81=E3=83=91=E3=83=A9=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E3=81=AB=E5=A4=B1=E6=95=97?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 641e322..66eedf3 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -652,32 +652,32 @@ Waifu2x::eWaifu2xError Waifu2x::CreateZoomColorImage(const cv::Mat &float_image, // processでcudnnが指定されなかった場合はcuDNNが呼び出されないように変更する Waifu2x::eWaifu2xError Waifu2x::ConstractNet(boost::shared_ptr> &net, const boost::filesystem::path &model_path, const boost::filesystem::path ¶m_path, const std::string &process) { - boost::filesystem::path caffemodel_path = param_path; - caffemodel_path += ".caffemodel"; boost::filesystem::path modelbin_path = model_path; modelbin_path += ".protobin"; + boost::filesystem::path caffemodel_path = param_path; + caffemodel_path += ".caffemodel"; - caffe::NetParameter param; + caffe::NetParameter param_model; caffe::NetParameter param_caffemodel; - const auto retModelBin = readProtoBinary(caffemodel_path, ¶m); - const auto retParamBin = readProtoBinary(modelbin_path, ¶m_caffemodel); + const auto retModelBin = readProtoBinary(modelbin_path, ¶m_model); + const auto retParamBin = readProtoBinary(caffemodel_path, ¶m_caffemodel); if (retModelBin == eWaifu2xError_OK && retParamBin == eWaifu2xError_OK) { Waifu2x::eWaifu2xError ret; - ret = SetParameter(param, process); + ret = SetParameter(param_model, process); if (ret != eWaifu2xError_OK) return ret; if (!caffe::UpgradeNetAsNeeded(caffemodel_path.string(), ¶m_caffemodel)) return Waifu2x::eWaifu2xError_FailedParseModelFile; - net = boost::shared_ptr>(new caffe::Net(param)); + net = boost::shared_ptr>(new caffe::Net(param_model)); net->CopyTrainedLayersFrom(param_caffemodel); - input_plane = param.input_dim(1); + input_plane = param_model.input_dim(1); } else {