From 41fdf561d8f307c7e595a18b7b19f74b61e1e299 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 3 Jul 2016 21:40:20 +0900 Subject: [PATCH] =?UTF-8?q?TTA=E3=83=A2=E3=83=BC=E3=83=89=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E3=81=AB=E5=8B=95=E4=BD=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 7742ab6..4195a9b 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -636,7 +636,7 @@ Waifu2x::eWaifu2xError Waifu2x::ReconstructByNet(std::shared_ptr net, cons cv::Mat reconstruct_image; for (int i = 0; i < 8; i++) { - cv::Mat in(im); + cv::Mat in(im.clone()); const int rotateNum = i % 4; RotateClockwise90N(in, rotateNum); @@ -644,7 +644,7 @@ Waifu2x::eWaifu2xError Waifu2x::ReconstructByNet(std::shared_ptr net, cons if (i >= 4) cv::flip(in, in, 1); // ] - ret = ProcessNet(net, crop_w, crop_h, use_tta, batch_size, im); + ret = ProcessNet(net, crop_w, crop_h, use_tta, batch_size, in); if (ret != Waifu2x::eWaifu2xError_OK) return ret; @@ -660,6 +660,8 @@ Waifu2x::eWaifu2xError Waifu2x::ReconstructByNet(std::shared_ptr net, cons } reconstruct_image /= 8.0; + + im = reconstruct_image; } return Waifu2x::eWaifu2xError_OK;