chaiNNer
chaiNNer copied to clipboard
Automatic crop or resize when upscaling using Waifu2x's ncnn model
Information:
- Chainner version: 0.21.2-nightly.2024-01-19
- OS: Windows 10 Version 22H2
Description https://github.com/nihui/waifu2x-ncnn-vulkan/releases When upscaling using the waifu2x-ncnn-vulkan model, the output image is incorrectly sized. 1x will crop by 28px and 2x will shrink by 36px.
Logs
main.log
croptest.chn.zip
This is actually an issue with the model technically. They should have put the padding they do inside what gets traced rather than expecting it to get done in preprocessing. To do this ourselves we'd need to have a good way to detect waifu2x models.
It would be much more worthwhile (imo) to just add support for waifu2x to spandrel which would therefore support converting those models to NCNN correctly
Looks like there was a problem with the model as you indicated. Just to be sure, I also tried the onnx model with 20.2, but the result is the same, outputting an incorrectly sized image. https://github.com/nagadomi/nunif/releases/tag/0.0.0
If Waifu2x is supported in the future, I would expect it.
It would be much more worthwhile (imo) to just add support for waifu2x to spandrel
Please make an issue that points to waifu2x PyTorch code.