Closed Selur closed 1 year ago
Using VSDIR with RGBH and VSGAN with RGBS:
from vsdpir import dpir as DPIR # adjusting color space from YUV420P8 to RGBH for vsDPIRDenoise clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="470bg", range_s="limited") # denoising using DPIRDenoise clip = DPIR(clip=clip, strength=5.000, task="denoise", device_index=0, trt=True, trt_cache_path="J:/tmp") # changing range from limited to full range clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full") # Setting color range to PC (full) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0) # adjusting color space from RGBH to RGBS for vsVSGAN clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="full") # resizing using VSGAN from vsgan import ESRGAN vsgan = ESRGAN(clip=clip,device="cuda") model = "C:/Users/Selur/Desktop/testing/1x_Dotzilla_Compact_80k_net_g.pth" vsgan.load(model) vsgan.apply() # 640x352 clip = vsgan.clip
fails with:
Input type (float) and bias type (struct c10::Half) should be the same
This is not a fault of VSGAN. The default floating point tensor type is changed to float16 in vsdpir when the input is of RGBH format. Add the following lines below dpir to change the type back to float32.
import torch
torch.set_default_tensor_type(torch.FloatTensor)
This is not a fault of VSGAN. The default floating point tensor type is changed to float16 in vsdpir when the input is of RGBH format. Add the following lines below dpir to change the type back to float32.
import torch torch.set_default_tensor_type(torch.FloatTensor)
Is there a reason your VS-DPIR sets it globally like that when using it? Since VS-DPIR is your project, do you have any recommendations on changes I could make to have full interoperability with your VS-DPIR project?
Okay, so adding
import torch
torch.set_default_tensor_type(torch.FloatTensor)
whenever I use dpir with 16bit is the way to go for now. Thanks!
I close this since it was fixed through https://github.com/HolyWu/vs-dpir/releases/tag/v3.0.1
I got a strange problem when using vsdpir and vsgan inside the same script:
using both with RGBH:
works.
using both with RGBS:
works.
Using VSDIR with RGBS and VSGAN with RGBH:
works.
Using VSDIR with RGBH and VSGAN with RGBS:
fails with:
Using VSDIR with RGBS and VSGAN with RGB48:
produces graphic glitches here https://ibb.co/jTCbghX