diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 86c82c1..8c2ed1e 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1050,7 +1050,10 @@ 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, in); + const int cw = (rotateNum % 2 == 0) ? crop_w : crop_h; + const int ch = (rotateNum % 2 == 0) ? crop_h : crop_w; + + ret = ProcessNet(net, cw, ch, use_tta, batch_size, in); if (ret != Waifu2x::eWaifu2xError_OK) return ret;