xinntao / Real-ESRGAN-ncnn-vulkan

NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.
https://github.com/xinntao/Real-ESRGAN
Other
1.42k stars 170 forks source link

webp input / output fails when using directories #20

Open nergdron opened 1 year ago

nergdron commented 1 year ago

I'm attempting to upscale some 480p content to 4k, and while it works fine if I use the same input and output formats, but when I attempt to change the format with -f it fails. given files in indir in png format:

# realesrgan-ncnn-vulkan -i indir/ -o outdir/ -s 4
[works fine]
# realesrgan-ncnn-vulkan -i indir/ -o outdir/ -s 4 -f webp
invalid outputpath extension type

this happens even if I choose the same format as the input format. looking at the code, main.cpp line 607 is the only instance of that error, and it's in an if block that reads as if (!path_is_directory(outputpath)), which means this shouldn't even be executing. I don't know why it's not reading this path as a directory, but it is, and then it seems to get confused and errors out.

note that if I do individual image files, webp seems to work fine, so I'm guessing this is a logic error in how whole directories are handled.

I'm on arch, and I've opened a bug there about this as well, in case this is an arch bug: https://aur.archlinux.org/packages/realesrgan-ncnn-vulkan#comment-874527

nergdron commented 1 year ago

I just verified I get the same behaviour with -f jpg, so it does seem to just be some kind of logic bug.

nergdron commented 1 year ago

there was another process on my system that was removing the output dir! not a bug, thanks for the great program. :grin: