Selur's Little Message Board

Full Version: Why VSGAN is not supported,...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, since every few month someone asks me why Hybrid does not support VSGAN (https://github.com/rlaPHOENiX/VSGAN) here's the answer:
It would increase Hybrids install size by 5,4 GB.

In case you want to verify it, here's how-to "Create a VSGAN portable version":
  • Download latest Vapoursynth portabe Fatpack (https://github.com/theChaosCoder/vapours...K/releases) and extract it to a folder
  • Delete the links an folders inside the VapourSynth64 aside from VapourSynth64 and the Scripts folder (optional)
  • Open a Windows command prompt and change into the VapourSynth64/VapourSynth64-folder.
  • Call `python.exe -m pip install --upgrade pip" to update pip` to update pip
  • Call `python.exe -m pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html` to install pytorch
    For cuda10 use `python.exe -m pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html` to install pytorch
  • Call `python.exe -m pip install pyd2v pymediainfo vsgan" to install vsgan`
  • Close Windows Command Prompt.
now you got a 6GB folder containing a portable Vapoursynth (~560MB) with VSGAN (~5.4GB).
So adding this to Hybrid would add an additional 5.4GB and this does not include any models (each ~64MB).

In case you want to try out VSGAN:
  • Download some models
  • I went to https://upscale.wiki/wiki/Model_Database and then to Anime Oldies Alternative (https://drive.google.com/drive/folders/1...o6Dnk-svNL) and downloaded the pth files and extract them somewhere.
  • Open VapourSynth64Portable\VapourSynth64\vsedit.exe and write a script like:
    Code:
    # Imports
    import vapoursynth as vs
    core = vs.get_core()
    # Loading Plugins
    from vsgan import VSGAN

    # Loading F:\TestClips&Co\files/5000frames.mp4 using LWLibavSource
    clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/files/5000frames.mp4", format="YUV420P10", cache=0, prefer_hw=0)
    # making sure input color matrix is set as 470bg
    clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
    # making sure frame rate is set to 25
    clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)

    # creating a VSGAN instance
    vsgan = VSGAN("cuda")
    # setting model
    model = "C:/Users/Selur/Desktop/Vapoursynth64portable/vsgan_models/PSNR Pretrain Models/4xPSNR.pth"
    vsgan.load_model(model)
    # convert clip color space from YUV420P8 to RGB24 for vsgan
    clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="limited")
    clip = vsgan.run(clip=clip)

    clip.set_output()
(paths need to be adjusted to your setup)
start the preview.

Cu Selur

Links to pth files:
Since I now offer an addon for Hybrid here's an updated how to, on how I create it:

What I did to create a portable Vapoursynth with pytorch&co: + additionally I pack the lated vsViewer and a folder named vsgan_models (collection of the models from https://upscale.wiki/wiki/Model_Database) in it.
After that it's ready.

Cu Selur
when updating basicvsrpp and torch use:
Code:
python -m pip install torch===1.10.0+cu111 torchvision===0.11.1 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install --upgrade https://github.com/HolyWu/vs-basicvsrpp/releases/download/v1.0.0/mmcv_full-1.3.16-cp39-cp39-win_amd64.whl
python -m pip install --upgrade vsbasicvsrpp
python -m vsbasicvsrpp