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 {