Skip to content
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

scunet_color_real_gan changes levels #2

Open
NSQY opened this issue Dec 31, 2022 · 3 comments
Open

scunet_color_real_gan changes levels #2

NSQY opened this issue Dec 31, 2022 · 3 comments

Comments

@NSQY
Copy link

NSQY commented Dec 31, 2022

Python 3.10.9
R61
GTX 1080
Driver Version: 525.60.11
CUDA Version: 12.0
Arch Linux

Might be PEBCAK.

https://slow.pics/c/38RmCJ0C

from vstools import vapoursynth, core, vs, depth
from vsscunet import scunet

def scunet_int(clip: vs.VideoNode, model=None) -> vs.VideoNode:
    _scunet = scunet(clip, model=model)
    return depth(_scunet, _scunet.format.bits_per_sample, sample_type=vs.SampleType.INTEGER)


rgb = core.imwri.Read(
    '/images data/Lenna.png'
    ).std.Crop(right=15)

ref = rgb.text.Text('ref')

rgb = depth(rgb, 16, sample_type=vs.SampleType.FLOAT)
format = 'RGBH' if rgb.format.bits_per_sample == 16 else 'RGBS'

ref.set_output()
images = [scunet_int(rgb, model=i).text.Text(f"model={i}, format={format}").set_output(i + 1) for i in range(5)]
@HolyWu
Copy link
Owner

HolyWu commented Dec 31, 2022

Unfortunately that's a problem of the pretrained model itself. cszn/SCUNet#13

@AIisCool
Copy link

AIisCool commented Mar 6, 2023

@NSQY If you don't mind my asking, how were you able to clean the image but retain the details? I've tried all the scunet models but while it cleans, it removes almost all the details.

@NSQY
Copy link
Author

NSQY commented Mar 7, 2023

@NSQY If you don't mind my asking, how were you able to clean the image but retain the details? I've tried all the scunet models but while it cleans, it removes almost all the details.

You should be able to reproduce the comparison with my provided code. scunet seems to perform particularly well on Lena, however it looks worse on more complex samples such as Lichtenstein.png

If you're looking for image restoration functions I suggest trying https://github.com/HolyWu/vs-dpir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants