Selur's Little Message Board
[INFO] Portable Vapoursynth (Windows) with pytorch&co - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html)
+--- Forum: A/V Talk (https://forum.selur.net/forum-6.html)
+--- Thread: [INFO] Portable Vapoursynth (Windows) with pytorch&co (/thread-2918.html)



Portable Vapoursynth (Windows) with pytorch&co - Selur - 13.11.2022

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 :
    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
    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++
      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/releases/download/v3.0.0/CUDA-11.7_cuDNN-8.6.0_TensorRT-8.5.1.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:
      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:
      PATH=i:\Hybrid\64bit\Vapoursynth\vsrife_dependencies;%PATH
      python -m vsrife
    • installed SWINIR
      python -m pip install --upgrade vsswinir
      python -m vsswinir
  • installed DPIR and onnxruntime-gpu
    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:
    # 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)
    python -m pip install --upgrade vsrealesrgan
    python -m vsrealesrgan
  • Installed HINet
    python -m pip install --upgrade vshinet
    python -m vshinet

Cu Selur


RE: Portable Vapoursynth (Windows) with pytorch&co - Bartoloni - 05.06.2023

thank you!