Selur's Little Message Board

Full Version: Portable Vapoursynth (Windows) with pytorch&co
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For those that might be interessted, wanting to update to vs-rife 3.0.0 I ended up setting up a new portable Vapoursynth for the torchAddon with dependencies again and I thought the steps I used might be interessting to some of you:
  • I created a new empy Vapoursynth-folder
  • downloaded 'Windows embeddable package (64-bit)' from https://www.python.org/downloads/release/python-3108/ (3.11 isn't supported atm. by Vapoursynth)
  • extracted the Python download into the download into the 'Vapoursynth'-folder
  • downloaded 'VapourSynth64-Portable-R60.7z' from https://github.com/vapoursynth/vapoursynth/releases
  • extracted the Vapoursynth portable download into the 'Vapoursynth'-folder
  • downloaded get-pip.py from https://bootstrap.pypa.io/get-pip.py and save it into the 'Vapoursynth'-folder
  • opened a 'Windows Command Prompt'-window and navigate into the 'Vaporusynth'-folder
  • installed pip by calling :
    Code:
    pyhton get-pip.py
  • opened the python310._pth in a text addition and added the following to lines above anything else in that file and saved the file
    Code:
    Scripts
    Lib\site-packages
  • installed VSGAN
    • python -m pip install vsgan
    • python -m pip install torch===1.13.0+cu117 torchvision==0.14.0 -f https://download.pytorch.org/whl/torch_stable.html
    • installed BASICVSR++
      Code:
      python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html
      python -m pip install tqdm
      python -m pip install opencv-python
      python -m pip install --upgrade vsbasicvsrpp
      python -m vsbasicvsrpp
  • installted RIFE
    • downloaded https://github.com/HolyWu/vs-rife/releas...7_win64.7z
    • extracted tensorrt-8.5.1.7-cp310-none-win_amd64.whl into my Vapoursynth folder
    • python -m pip install tensorrt-8.5.1.7-cp310-none-win_amd64.whl
    • deleted tensorrt-8.5.1.7-cp310-none-win_amd64.whl
    • python -m pip install --upgrade vsrife
    • created a folder 'vsrife_dependencies' inside the Vapoursynth folder and copied the other files form the CUDA-11.7_cuDNN-8.6.0_TensorRT-8.5.1.7_win64.7z into it. This folder need to be added to when using vs-rife using:
      Code:
      import site
      # add vs-rife dependencies to the path
      path = site.getsitepackages()[0]+'/vsrife_dependencies/'
      path = path.replace('\\', '/')
      import os
      os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]
    • downloaded the models using:
      Code:
      PATH=i:\Hybrid\64bit\Vapoursynth\vsrife_dependencies;%PATH
      python -m vsrife
    • installed SWINIR
      Code:
      python -m pip install --upgrade vsswinir
      python -m vsswinir
  • installed DPIR and onnxruntime-gpu
    Code:
    python -m pip install --upgrade vsdpir
    python -m pip install --upgrade onnxruntime-gpu
    python -m vsdpir
  • created a onnxruntime_dlls folder inside the Vapoursynth folder.
    I copied from cudnn-11.4-windows-x64-v8.2.4.15.zip and NVIDIA CUDA SDK 11.4.1 runtimes the following files into the folder:
    • cublas64_11.dll
    • cublasLt64_11.dll
    • cudart64_110.dll
    • cudnn_cnn_infer64_8.dll
    • cudnn_ops_infer64_8.dll
    • cudnn64_8.dll
    • cufft64_10.dll
    • cufftw64_10.dll
    • msvcp140.dll
    • nvinfer.dll
    • nvinfer_builder_resource.dll
    • nvinfer_plugin.dll
    • nvonnxparser.dll
    • nvparsers.dll
    • vcruntime140.dll
    • vcruntime140_1.dll
  • When using vsdir or realesrgan in a Vapoursynth script:
    Code:
    # Import libraries for onnxruntime
    import site
    import ctypes
    path = site.getsitepackages()[0]+'/onnxruntime_dlls/'
    ctypes.windll.kernel32.SetDllDirectoryW(path)
    needs to be added to the script to load the dlls.
  • installed REALESRGAN (which also uses onnxruntime)
    Code:
    python -m pip install --upgrade vsrealesrgan
    python -m vsrealesrgan
  • Installed HINet
    Code:
    python -m pip install --upgrade vshinet
    python -m vshinet

Cu Selur
thank you!