From d5c908708528bc4ee8e57190d084776af36798bc Mon Sep 17 00:00:00 2001 From: TNTwise Date: Sat, 14 Dec 2024 19:02:15 -0600 Subject: [PATCH] logs --- backend/src/pytorch/InterpolateTorch.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/pytorch/InterpolateTorch.py b/backend/src/pytorch/InterpolateTorch.py index 49dafb87..91136c14 100644 --- a/backend/src/pytorch/InterpolateTorch.py +++ b/backend/src/pytorch/InterpolateTorch.py @@ -103,6 +103,10 @@ def dynamicScaleCalculation(self,frame1): def __call__(self, img1, writeQueue:Queue, transition=False, upscaleModel:UpscalePytorch = None): # type: ignore """Perform processing""" + def initLog(self): + printAndLog("Using device: " + str(self.device)) + printAndLog("Using dtype: " + str(self.dtype)) + @torch.inference_mode() def norm(self, frame: torch.Tensor): return ( @@ -148,17 +152,21 @@ def __init__( dtype: str = "auto", backend: str = "pytorch", UHDMode: bool = False, + ensemble: bool = False, + dynamicScaledOpticalFlow: bool = False, *args, **kwargs, ): - - printAndLog("Using device: " + str(device)) - self.interpolateModel = modelPath self.width = width self.height = height self.device = self.handleDevice(device) self.dtype = self.handlePrecision(dtype) + if ensemble: + print("Ensemble is not implemented for GIMM, disabling", file=sys.stderr) + if dynamicScaledOpticalFlow: + print("Dynamic Scaled Optical Flow is not implemented for GIMM, disabling",file=sys.stderr) + self.backend = backend self.ceilInterpolateFactor = ceilInterpolateFactor self.frame0 = None @@ -166,7 +174,7 @@ def __init__( if UHDMode: self.scale = 0.25 # GIMM uses fat amounts of vram, needs really low flow resolution for UHD self.doEncodingOnFrame = False - + self.initLog() self._load() @torch.inference_mode() @@ -285,8 +293,6 @@ def __init__( *args, **kwargs, ): - - self.frame0 = None self.interpolateModel = modelPath self.width = width @@ -409,13 +415,14 @@ def __init__( *args, **kwargs, ): - printAndLog("Using device: " + str(device)) + self.interpolateModel = modelPath self.width = width self.height = height self.device:torch.device = self.handleDevice(device) self.dtype = self.handlePrecision(dtype) + self.initLog() self.backend = backend self.ceilInterpolateFactor = ceilInterpolateFactor self.dynamicScaledOpticalFlow = dynamicScaledOpticalFlow