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.
Pages: 1 2 3
Go compile vsViewer on Windows I usually:
  • install Visual Studio Community, then Qt 6.6 with QCreator.
  • start QCreator
  • Open the vsViewer.pro file
  • Then Configure the Project (Projects->Configure Project) to use "Desktop Qt 6.6)
  • then I switch to Release (lower right corner)
  • Start the compilation (Build->Rebuild)
(don't think I missed anything)

Cu Selur
thanks Selur !

I ... I almost ... finished :p

probably tomorrow
it took long as not familiar with Qt but that s ok


my last mile : 

when i try hybrid + vapoursynth +vsviewer, i get this error below in vsviewer window.
i ll check more tomorrow or this weekend 

Code:
Failed to evaluate the script: Python exception: Expr: failed to convert '0.5' to float, not the whole token could be converted Traceback (most recent call last): File "src\\cython\\vapoursynth.pyx", line 3121, in vapoursynth._vpy_evaluate File "src\\cython\\vapoursynth.pyx", line 3122, in vapoursynth._vpy_evaluate File "S:\le_film\tempPreviewVapoursynthFile23_20_35_120.vpy", line 46, in clip = havsfunc.QTGMC(Input=clip, Preset="Placebo", InputType=0, TFF=False, TR2=0, Sharpness=0.5, SourceMatch=0, Lossless=0, EZDenoise=0.70, NoisePreset="Slower", MatchPreset="Placebo", MatchPreset2="Placebo", MatchEnhance=0.40, opencl=True, Denoiser="KNLMeansCL") # new fps: 50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Hybrid\64bit\vsscripts\havsfunc.py", line 2065, in QTGMC resharp = core.std.Expr([lossed1, vresharp.std.Convolution(matrix=matrix)], expr=f'x x y - {sharpAdj} * +') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "src\\cython\\vapoursynth.pyx", line 2857, in vapoursynth.Function.__call__ vapoursynth.Error: Expr: failed to convert '0.5' to float, not the whole token could be converted


I think it may be related to locale and python .. i ll check later

*confirmed it is related to my vapoursynth build. i ll redo it
YES ! 

I did it , it works on my side as expected.

do you want to me to share something on how i proceed, starting from scratch ? 
it is based on your process described at your post on doom9 ,and this post here.

i ended with the current hybrid release, the new hybrid scripts (thank you for updating then 2 days ago),
and the following modules for vapoursynth
Code:
Package                Version ---------------------- ------------ addict                2.4.0 antlr4-python3-runtime 4.9.3 certifi                2023.7.22 charset-normalizer    3.3.1 colorama              0.4.6 contourpy              1.1.1 cupy-cuda11x          12.2.0 cycler                0.12.1 einops                0.7.0 fastrlock              0.8.2 filelock              3.13.0 fonttools              4.43.1 fsspec                2023.10.0 huggingface-hub        0.18.0 idna                  3.4 importlib-metadata    6.8.0 Jinja2                3.1.2 kiwisolver            1.4.5 markdown-it-py        3.0.0 MarkupSafe            2.1.3 matplotlib            3.8.0 mdurl                  0.1.2 mmcv                  2.1.0 mmengine              0.9.0 mpmath                1.3.0 networkx              3.2.1 numpy                  1.26.1 omegaconf              2.3.0 opencv-python          4.8.1.78 packaging              23.2 Pillow                10.1.0 pip                    23.3.1 platformdirs          3.11.0 Pygments              2.16.1 pyparsing              3.1.1 python-dateutil        2.8.2 PyYAML                6.0.1 regex                  2023.10.3 requests              2.31.0 rich                  13.6.0 safetensors            0.4.0 setuptools            68.2.2 six                    1.16.0 sympy                  1.12 tensorrt              8.6.1 termcolor              2.3.0 timm                  0.9.8 tomli                  2.0.1 torch                  2.1.0+cu118 torch-tensorrt-fx-only 1.5.0.dev0 torchvision            0.16.0+cu118 tqdm                  4.66.1 typing_extensions      4.8.0 urllib3                2.0.7 VapourSynth            64 vsanimesr              1.0.0 vsbasicvsrpp          2.1.0 vscodeformer          1.0.1 vsdpir                3.1.1 vsfemasr              1.2.0 vsgan                  1.6.4 vsgmfss_fortuna        1.0.0 vsgrlir                1.1.1 vshinet                1.0.0 vsrealesrgan          4.1.0 vsrife                4.1.0 vsscunet              1.0.0 vsswinir              2.0.0 vstools                2.3.0 vsutil                0.8.0 wheel                  0.41.2 yapf                  0.40.2 zipp                  3.17.0 CUDA-11.8 cuDNN-8.9.1 TensorRT-8.6.1.6


it left one thing i need to understand, it is about your vsgan_models folder, containing models downloaded from the database  site : i will look later how to integrate then in the drop menu

and of course to extend testing.
tell me if i missed something somewhere !

kr

ld
Not sure in what drop-down menu you want to integrate them.
In Hybrid those are simply in the folder which Hybrid looks (Hybrid expects the folder next to the Hybrid.exe) for if vsgan is used, but they and other vsgan compatible models can be simply selected. (same for the onnx models for vs-mlrt)

Cu Selur

Ps.: https://openmodeldb.info/ has additional models and chainNNer can be used to convert .pth models to .onnx models.
oh, i had in mind that it would appear in tab vapoursynth/Frame/Resize
selected resizer : RealESRGAN and model droplist

i tried to put vsgan_models at hybrid.exe level, i also put the same folder inside the vapoursynth folder.

i imagine that a setting should be set somewhere, to look into this folder.


then for example i downloaded the model 4x_BooruGan_650k.pth . i thought it would be used by realesrgan.
what do i miss about the place?

here a list of all .pth location on my side
screenshot of .pth

i think my understanding about this is .. far away from the correct way to go with models lol ..
VSGAN should appear as a Resizer
ouch , it is not ...
you mean in vapoursynth/Frame/Resize ?

i see

Code:
NNEDI 3 fmtconv ResampleHQ waifu2x waifu2x nvk Anime4KCPP SRMD RealSR GLSL Resizer DPID SSIMD DGdecNV / Crop/Resize RealESRGAN BasicVSR++ SwinIR RealCUGAN AnimeSR FemaSR


but not VSGAN :/

i used the command with success as following
Code:
python -m pip install vsgan



if i try these following command , everything is ok.
Code:
E:\Hybrid\64bit\vapoursynth>python -m pip install -U vsgan Requirement already satisfied: vsgan in e:\hybrid\64bit\vapoursynth\lib\site-packages (1.6.4) Requirement already satisfied: numpy<2.0.0,>=1.21.1 in e:\hybrid\64bit\vapoursynth\lib\site-packages (from vsgan) (1.26.1) E:\Hybrid\64bit\vapoursynth>python -m pip install --upgrade -U vsgan Requirement already satisfied: vsgan in e:\hybrid\64bit\vapoursynth\lib\site-packages (1.6.4) Requirement already satisfied: numpy<2.0.0,>=1.21.1 in e:\hybrid\64bit\vapoursynth\lib\site-packages (from vsgan) (1.26.1) E:\Hybrid\64bit\vapoursynth>python -m pip install vsgan Requirement already satisfied: vsgan in e:\hybrid\64bit\vapoursynth\lib\site-packages (1.6.4) Requirement already satisfied: numpy<2.0.0,>=1.21.1 in e:\hybrid\64bit\vapoursynth\lib\site-packages (from vsgan) (1.26.1) E:\Hybrid\64bit\vapoursynth>
Quote:Yes, if everything was
yes.

Hybrid will on start-up look what extensions&co are available and then list then in the log tab.
I for example see:
Code:
Detected NVIDIA PureVideo compatible cards: NVIDIA GeForce RTX 4080 Detected vfwDecoders with 32bit: VIDC.LAGS VIDC.WMV3 vidc.cvid vidc.i420 vidc.iyuv vidc.mrle vidc.msvc vidc.uyvy vidc.yuy2 vidc.yvu9 vidc.yvyu Detected vfw64BitDecoders: VIDC.LAGS VIDC.WMV3 vidc.cvid vidc.i420 vidc.iyuv vidc.mrle vidc.msvc vidc.uyvy vidc.yuy2 vidc.yvu9 vidc.yvyu Avisynth+ is available,.. DGDecNV available,.. Vapoursynth is available,.. DGDecNV available,.. VSGAN available,.. vsDPIR available,.. vsRIFE (torch) available,.. vsGMFSS fortuna available,.. vsBasicVSR++ available,.. vsRealESRGAN available,.. vsSwinIR available,.. vsHINet available,.. vsAnimeSR available,.. vsFeMaSR available,.. vsSCUNet available,.. vsCodeFormer available,.. vsGRLIR available,.. VSMLRT available,.. vsRIFE (mlrt) available,.. vsDPIR (mlrt) available,.. Finished startup, finished after 11.494s

Okay, I just checked the code, Hybrid will only show vsgan if the model folder is available:
Code:
QString vsgan = StaticHelper::relativeToAbsolutePath("./64bit/vsgan_models"); m_optionalAvailableFilters.insert(QString("VSGAN"), FileHelper::existFolder(vsgan)); QString vsdpir = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsdpir"); m_optionalAvailableFilters.insert(QString("VSDPIR"), FileHelper::existFolder(vsdpir)); QString torchRife = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsrife"); m_optionalAvailableFilters.insert(QString("VSTORCHRIFE"), FileHelper::existFolder(torchRife)); QString gmfssfortuna = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsgmfss_fortuna"); m_optionalAvailableFilters.insert(QString("VSGMFSSFORTUNA"), FileHelper::existFolder(gmfssfortuna)); QString realsrgan = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsrealesrgan"); m_optionalAvailableFilters.insert(QString("VSREALESRGAN"), FileHelper::existFolder(realsrgan)); QString basicvsrpp = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsbasicvsrpp"); m_optionalAvailableFilters.insert(QString("VSBASICVSRPP"), FileHelper::existFolder(basicvsrpp)); QString vsswinir = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsswinir"); m_optionalAvailableFilters.insert(QString("VSSWINIR"), FileHelper::existFolder(vsswinir)); QString vshinet = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vshinet"); m_optionalAvailableFilters.insert(QString("VSHINET"), FileHelper::existFolder(vshinet)); QString ansimesr = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsanimesr"); m_optionalAvailableFilters.insert(QString("VSANIMESR"), FileHelper::existFolder(ansimesr)); QString femasr = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsfemasr"); m_optionalAvailableFilters.insert(QString("VSFEMASR"), FileHelper::existFolder(femasr)); QString scunet = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsscunet"); m_optionalAvailableFilters.insert(QString("VSSCUNET"), FileHelper::existFolder(scunet)); QString vscodeformer = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vscodeformer"); m_optionalAvailableFilters.insert(QString("VSCODEFORMER"), FileHelper::existFolder(vscodeformer)); m_optionalAvailableFilters.insert(QString("VSREALCUGAN"), true); QString vsgrlir = StaticHelper::relativeToAbsolutePath("./64bit/Vapoursynth/Lib/site-packages/vsgrlir"); m_optionalAvailableFilters.insert(QString("VSGRLIR"), FileHelper::existFolder(vsgrlir)); QString vsmlrt = StaticHelper::relativeToAbsolutePath("./64bit/vs-mlrt"); m_optionalAvailableFilters.insert(QString("VSMLRT"), FileHelper::existFolder(vsmlrt));
=> what does it show in your Log-tab after starting?

Cu Selur

Ps.:
Like I wrote before:
Quote:That said, I have torch&mlrt addons for Hybrid nowadays, see: https://forum.selur.net/thread-2820.html
(drop a post there, that you also would like the addons and I'll send you my current links via pm after work)
Here's also a list ov the versions I got installed atm. (VapourSynth version isn't really correct, since i installed Vapoursynth R65 in the Vapoursynth folder, but I did that after installing the rest so pip doesn't know about it.)
Code:
Package Version ---------------------- --------------------- addict 2.4.0 antlr4-python3-runtime 4.9.3 bleach 6.0.0 certifi 2023.5.7 charset-normalizer 3.1.0 click 8.1.3 colorama 0.4.6 coloredlogs 15.0.1 contourpy 1.0.7 cupy-cuda11x 12.0.0 cycler 0.11.0 docutils 0.20.1 einops 0.6.1 fastrlock 0.8.1 filelock 3.12.0 flatbuffers 23.5.9 fonttools 4.39.4 fsspec 2023.5.0 huggingface-hub 0.14.1 humanfriendly 10.0 idna 3.4 importlib-metadata 6.6.0 jaraco.classes 3.2.3 Jinja2 3.1.2 keyring 23.13.1 kiwisolver 1.4.4 Markdown 3.4.3 markdown-it-py 2.2.0 MarkupSafe 2.1.2 matplotlib 3.7.1 mdurl 0.1.2 mmcv 2.0.0 mmengine 0.7.3 model-index 0.1.11 more-itertools 9.1.0 mpmath 1.3.0 networkx 3.1 numpy 1.26.0 omegaconf 2.3.0 opencv-python 4.7.0.72 openmim 0.3.7 ordered-set 4.1.0 ort-nightly 1.16.0.dev20230516003 packaging 23.2 pandas 2.0.1 pefile 2023.2.7 Pillow 9.5.0 pip 23.3.1 pip-autoremove 0.10.0 pkginfo 1.9.6 protobuf 4.23.1 pydot 1.4.2 Pygments 2.15.1 pyparsing 3.0.9 PyQt6 6.5.3 PyQt6-Qt6 6.5.3 PyQt6-sip 13.6.0 pyreadline3 3.4.1 python-dateutil 2.8.2 pytz 2023.3 pywin32 306 pywin32-ctypes 0.2.0 PyYAML 6.0 QDarkStyle 3.2 QtPy 2.4.1 readme-renderer 37.3 regex 2023.5.5 requests 2.31.0 requests-toolbelt 1.0.0 rfc3986 2.0.0 rich 13.3.5 safetensors 0.3.1 setuptools 67.7.2 six 1.16.0 sympy 1.12 tabulate 0.9.0 tensorrt 8.6.1 termcolor 2.3.0 timm 0.9.2 tomli 2.0.1 torch 2.0.1+cu118 torch-tensorrt-fx-only 1.5.0.dev0 torchvision 0.15.2+cu118 tqdm 4.66.1 twine 4.0.2 typing_extensions 4.5.0 tzdata 2023.3 urllib3 2.0.2 VapourSynth 64 vsanimesr 1.0.0 vsbasicvsrpp 2.1.0 vscodeformer 1.0.1 vsdpir 3.1.1 vsengine 0.2.0 vsfemasr 1.2.0 vsgan 1.6.4 vsgmfss_fortuna 1.0.0 vsgrlir 1.1.1 vshinet 1.0.0 vspreview 0.7.1 vsrealesrgan 4.1.0 vsrife 4.1.0 vsscunet 1.0.0 vsswinir 2.0.0 vstools 2.3.0 vsutil 0.8.0 webencodings 0.5.1 wheel 0.40.0 yapf 0.33.0 zipp 3.15.0

Cu Selur
here the log show on my side
Code:
Detected NVIDIA PureVideo compatible cards: NVIDIA GeForce RTX 4090 Detected vfwDecoders with 32bit:  vidc.cvid  vidc.i420  vidc.iyuv  vidc.mrle  vidc.msvc  vidc.uyvy  vidc.yuy2  vidc.yvu9  vidc.yvyu Detected vfw64BitDecoders:  vidc.cvid  vidc.i420  vidc.iyuv  vidc.mrle  vidc.msvc  vidc.uyvy  vidc.yuy2  vidc.yvu9  vidc.yvyu   Avisynth+ is available,..     DGDecNV available,..   Vapoursynth is available,..     DGDecNV available,..     vsDPIR available,..     vsRIFE (torch) available,..     vsBasicVSR++ available,..     vsRealESRGAN available,..     vsSwinIR available,..     vsHINet available,..     vsAnimeSR available,..     vsFeMaSR available,..     vsSCUNet available,.. Current defaultOutputPath: is empty! -> Set it under Config->Path Current defaultTempPath: is empty! -> Set it under Config->Path Finished startup, finished after 10.648s


I move now vsgan_models to "./64bit/vsgan_models"

and here the log , VSGAN is detected
Code:
Detected NVIDIA PureVideo compatible cards: NVIDIA GeForce RTX 4090 Detected vfwDecoders with 32bit:  vidc.cvid  vidc.i420  vidc.iyuv  vidc.mrle  vidc.msvc  vidc.uyvy  vidc.yuy2  vidc.yvu9  vidc.yvyu Detected vfw64BitDecoders:  vidc.cvid  vidc.i420  vidc.iyuv  vidc.mrle  vidc.msvc  vidc.uyvy  vidc.yuy2  vidc.yvu9  vidc.yvyu   Avisynth+ is available,..     DGDecNV available,..   Vapoursynth is available,..     DGDecNV available,..     VSGAN available,..     vsDPIR available,..     vsRIFE (torch) available,..     vsBasicVSR++ available,..     vsRealESRGAN available,..     vsSwinIR available,..     vsHINet available,..     vsAnimeSR available,..     vsFeMaSR available,..     vsSCUNet available,.. Current defaultOutputPath: is empty! -> Set it under Config->Path Current defaultTempPath: is empty! -> Set it under Config->Path Finished startup, finished after 10.625s

yay VSGAN is present 
i update the procedure on my side
Pages: 1 2 3