diff --git a/waifu2x-caffe/Source.cpp b/waifu2x-caffe/Source.cpp index 44f4235..26fbd77 100644 --- a/waifu2x-caffe/Source.cpp +++ b/waifu2x-caffe/Source.cpp @@ -131,6 +131,14 @@ int main(int argc, char** argv) "input image split size", false, 128, "int", cmd); + TCLAP::ValueArg cmdCropWidth("", "crop_w", + "input image split size(width)", false, + 128, "int", cmd); + + TCLAP::ValueArg cmdCropHeight("", "crop_h", + "input image split size(height)", false, + 128, "int", cmd); + TCLAP::ValueArg cmdBatchSizeFile("b", "batch_size", "input batch size", false, 1, "int", cmd); @@ -177,6 +185,15 @@ int main(int argc, char** argv) return 1; } + int crop_w = cmdCropSizeFile.getValue(); + int crop_h = cmdCropSizeFile.getValue(); + + if (cmdCropWidth.isSet()) + crop_w = cmdCropWidth.getValue(); + + if (cmdCropHeight.isSet()) + crop_h = cmdCropHeight.getValue(); + if (cmdScaleWidth.getValue() > 0) ScaleWidth = cmdScaleWidth.getValue(); else if (cmdScaleHeight.getValue() > 0) @@ -382,7 +399,7 @@ int main(int argc, char** argv) for (const auto &p : file_paths) { const Waifu2x::eWaifu2xError ret = w.waifu2x(p.first, p.second, ScaleRatio, ScaleWidth, ScaleHeight, nullptr, - cmdCropSizeFile.getValue(), cmdCropSizeFile.getValue(), + crop_w, crop_h, cmdOutputQuality.getValue() == -1 ? boost::optional() : cmdOutputQuality.getValue(), cmdOutputDepth.getValue(), use_tta, cmdBatchSizeFile.getValue()); if (ret != Waifu2x::eWaifu2xError_OK) {