mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 05:32:47 +00:00
CUI版でcrop_w,crop_hオプション追加
This commit is contained in:
parent
943b7de3ed
commit
816aa2a758
@ -131,6 +131,14 @@ int main(int argc, char** argv)
|
||||
"input image split size", false,
|
||||
128, "int", cmd);
|
||||
|
||||
TCLAP::ValueArg<int> cmdCropWidth("", "crop_w",
|
||||
"input image split size(width)", false,
|
||||
128, "int", cmd);
|
||||
|
||||
TCLAP::ValueArg<int> cmdCropHeight("", "crop_h",
|
||||
"input image split size(height)", false,
|
||||
128, "int", cmd);
|
||||
|
||||
TCLAP::ValueArg<int> 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<int>() : cmdOutputQuality.getValue(), cmdOutputDepth.getValue(), use_tta, cmdBatchSizeFile.getValue());
|
||||
if (ret != Waifu2x::eWaifu2xError_OK)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user