-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waifu2x-cunet brightness bug #2
Comments
Could you provide your script for verification? The parameters in these models are exactly the same. |
ncnn-vulkan-R3.2 and ncnn-vulkan-R4 also use the same model file, the problem may be in the implementation. I already tried to use #vs-mlrt-v8
from vsmlrt import Waifu2x, Waifu2xModel, Backend
import vapoursynth as vs
core = vs.core
src = core.imwri.Read("sample.png")
rgbs = src.resize.Point(format=vs.RGBS)
spline = rgbs.resize.Spline36(1920, 1080)
spline_y = spline.resize.Point(format=vs.YUV444PS, matrix=1).std.ShufflePlanes([0], vs.GRAY)
w2x = Waifu2x(rgbs, noise=-1, scale=2, model=Waifu2xModel.cunet,
backend=Backend.ORT_CUDA())
w2x_y = w2x.resize.Point(format=vs.YUV444PS, matrix=1).std.ShufflePlanes([0], vs.GRAY)
w2x_y.set_output()
########################################
#vs-mlrt-v2
import vapoursynth as vs
core = vs.core
src = core.imwri.Read("sample.png")
rgbs = src.resize.Point(format=vs.RGBS)
spline = rgbs.resize.Spline36(1920, 1080)
spline_y = spline.resize.Point(format=vs.YUV444PS, matrix=1).std.ShufflePlanes([0], vs.GRAY)
w2x = rgbs.ort.Model(r"C:\Program Files\VapourSynth\plugins\waifu2x\cunet\noise0_scale2.0x_model.onnx")
w2x_y = w2x.resize.Point(format=vs.YUV444PS, matrix=1).std.ShufflePlanes([0], vs.GRAY)
w2x_y.set_output() |
Lines 210 to 213 in a235833
|
My bad, I used the wrong model in v2, my issue is with noise disabled. |
Yeah, I use the same model from waifu2x-caffe so the issue is similar. |
ncnn-vulkan-R3.2 is the only one without this problem for noise disabled, the problem is that it is very slow, and the bug was added in the last release (R4), even though very few changes were made between this versions. |
Could you verify whether the problem is related to |
The result was the same: https://slow.pics/c/hczpYTtr |
Personally, I believe there is not guarantee that the average brightness remains constant after filtered by waifu2x. Such requirement can be satisfied by post-processing. |
The current cunet-model version makes the output darker than it should be.
It is a known bug in VS's Waifu2x ports, as it happens in the caffe port and was introduced to ncnn-vulkan in R4.
ncnn-vulkan-R3.2 is the only one that doesn't have the bug.
Here a comparison showing the input and the difference between a spline resize, vs-mlrt-v2 and vs-mlrt-v8, apparently the bug was introduced after v2: https://slow.pics/c/myFP5fXB
The text was updated successfully, but these errors were encountered: