This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Deoldify Vapoursynth filter
The headers and dll should be somwhere under Lib/site-packages,... but I'll do some testing after work.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
You're right, the dlib initialization script requires the user to have the CUDA SDK and cuDNN installed, while torch only needs to be installed in the same environment.
Replace the __init__.py file in the dlib folder with the attached version and clear the cache.

Key Changes applied in the attached script:

  1. Removed Static CUDA Paths: Eliminated hardcoded references to the NVIDIA CUDA Toolkit.
  2. Dynamic Torch Path Detection: Used torch.__file__ to locate the torch package and constructed the path to its lib folder.
  3. Windows-Specific Logic: Wrapped the DLL path modification in a check for os.name == 'nt' to ensure it only runs on Windows.
  4. Robust Error Handling: Maintained try-except blocks to prevent failures if torch is not installed or paths are inaccessible.

Installation Requirement:

Ensure that the torch package with CUDA 13.0 is installed in the same Python environment as dlib, so that the script can locate torch\lib correctly.

This modification allows dlib to dynamically use the CUDA DLLs bundled with torch, improving portability and reducing dependency on system-wide CUDA installations.

Dan

P.S.
Tested and working on my side.


Attached Files
.zip   __init__.zip (Size: 865 bytes / Downloads: 1)
Reply
I installed 'dlib-20.0.99-cp313-cp313-win_amd64.whl', then replaced the __init__.py, made sure to delete the __pycache__ folder inside Hybrid\64bit\Vapoursynth\Lib\site-packages\dlib and Hybrid\64bit\Vapoursynth\Lib\site-packages.
Sadly I get:
2026-02-16 18:46:54.861
Error on frame 0 request:

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3222, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 3224, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 837, in vapoursynth.FuncData.__call__
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\utils\_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\__init__.py", line 122, in inference
face_helper[local_index].get_face_landmarks_5(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
only_center_face=only_center_face, resize=640, eye_dist_threshold=5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\face_restoration_helper.py", line 218, in get_face_landmarks_5
return self.get_face_landmarks_5_dlib(only_keep_largest)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\face_restoration_helper.py", line 182, in get_face_landmarks_5_dlib
det_faces = self.face_detector(self.input_img, scale)
RuntimeError: Error while calling cudaOccupancyMaxPotentialBlockSize(&num_blocks,&num_threads,K) in file D:\PProjects\dlib\dlib\cuda\cuda_utils.h:164. code: 209, reason: no kernel image is available for execution on the device
Hmmm,... I see 'cuda-toolkit 13.1.1' in my pip list output.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
But the output of:  test_dlib_cuda_13.py ?

This is my env

build                       1.4.0
colorama                    0.4.6
dlib                        20.0.99
filelock                    3.20.0
fsspec                      2025.12.0
Jinja2                      3.1.6
MarkupSafe                  2.1.5
mpmath                      1.3.0
networkx                    3.6.1
ninja                       1.13.0
numpy                       2.3.5
packaging                   25.0
pefile                      2024.8.26
pillow                      12.0.0
pip                         26.0.1
pyproject_hooks             1.2.0
setuptools                  82.0.0
spatial_correlation_sampler 0.5.0
sympy                       1.14.0
torch                       2.10.0+cu130
torchvision                 0.25.0+cu130
typing_extensions           4.15.0
wheel                       0.46.3
Reply


Forum Jump:


Users browsing this thread: 36 Guest(s)