Jaded-Encoding-Thaumaturgy / vs-denoise

VapourSynth denoising, regression, and motion compensation functions
MIT License
18 stars 6 forks source link

Fix TRT selection in dpir #116

Closed sgt0 closed 5 months ago

sgt0 commented 5 months ago

The cuda is None check is useless because cuda is always defined by line 73 after the 0b3a10546183dbec946aa1d5e434e13729b727c9 refactor (this is caught by mypy). So what actually ends up happening is that the TRT backend is always chosen if it's supported by the current system, even if the user explicitly wants another backend.

Before:

dpir(clip)
# backend = Backend.TRT

dpir(clip, cuda=False)
# backend = Backend.TRT

dpir(clip, cuda=True)
# backend = Backend.TRT

dpir(clip, cuda="trt")
# backend = Backend.TRT

After:

dpir(clip)
# backend = Backend.TRT

dpir(clip, cuda=False)
# backend = Backend.NCNN_VK

dpir(clip, cuda=True)
# backend = Backend.ORT_CUDA

dpir(clip, cuda="trt")
# backend = Backend.TRT
Vodes commented 5 months ago

Bruh