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.

Improving CodeFormer videos
#51
Please note that usually you add in all the scripts using CUDA, the following code:

# Adding torch dependencies to PATH
path = site.getsitepackages()[0]+'/torch_dependencies/bin/'
ctypes.windll.kernel32.SetDllDirectoryW(path)
path = path.replace('\\', '/')
os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]

In the case of CodeFormer you don't add this code, because "dlib" is able to find the CUDA itself, but If you want help "dlib" to find CUDA on PC with a different installation you should add this code.

Please add it and let me know if it works.

Dan
Reply
#52
Bingo! Adding torch dependencies to path does help! Big Grin
(Hybrid didn't add it since it wasn't necessary before.)

Cu Selur
Reply
#53
With CUDA enabled "dlib", CodeFormer it is a perfect match for RealESRGAN. Big Grin

See "28 Days Later..."

https://imgsli.com/MjQwMzE2

While with "retinaface" CodeFormer is not usable to encode videos (*) because are introduced too many artifacts

Dan

(*) With pictures "retinaface" is Ok
Reply
#54
That said, happy that it's a good solution for your usage.
https://imgsli.com/MjQwMzE2
Personally I think that looks horrible, face enhancement is way to detailed for the rest and the background looks too blocky.
Maybe try FeMaSR instead, might look good or really horrible depending on the source. Wink

Cu Selur

Ps.: did the version I send you also support FeMaSR for CodeFormer (I added it, but don't know whether the version I send you already supported it)
PPs.: send you a link to my current dev.
Reply
#55
Hello Selur,

  I tested your dev version and I found the following problems:

   1) FeMaSR 1.2 TensorRT is not working (actually never worked in RT on my PC since the bump version to 1.2)
       I had to downgrade to  FeMaSR 1.1 TensorRT to be able to use the filter in RT mode
   2) The FeMaSR included in CodeFormer is using fp32 and is too slow to be practically used, please use as default fp16
   3) In the FeMaSR included in CodeFormer is not used the parameter trt_min_subgraph_size, I suggest to set it = 5 (should be good for every one)

  I do agree with you that FeMaSR could be better than RealESRGAN, see the comparison:

  https://imgsli.com/MjQwMzY2

  The problem is that is too slow, on my PC the speed is about 3fps (with TensoRT fp16) while with RealESRGAN I can get a speed around 6fps.
  I need to do more tests to understand better when to use one of them.

Thanks
Dan
Reply
#56
regarding 1: works fine here Smile
regarding 2&3: I'll adjust Hybrid to use FP16 and trt_min_subgraph_size=5
Regarding speed: Yes, FeMaSR is slower.

Cu Selur
Reply
#57
(16.02.2024, 05:33)Selur Wrote: regarding 1: works fine here Smile

Probably my RTX3060 is not big enough to support the Tensor-RT implementation of version 1.2
Reply
#58
(16.02.2024, 05:33)Selur Wrote: regarding 2&3: I'll adjust Hybrid to use FP16 and trt_min_subgraph_size=5

In the last dev version is generate: trt_min_subgraph_size="5"  (5 as string instead of an integer)
Reply
#59
argh,.. will fix
Reply
#60
Send you a new link. Smile

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)