From f0de079cbf829b45096235b862391b3b6f6610a5 Mon Sep 17 00:00:00 2001 From: Georg Legato Date: Sat, 13 May 2023 20:49:30 +0200 Subject: [PATCH] fix staticmethod glitch --- iz_helpers/run.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/iz_helpers/run.py b/iz_helpers/run.py index 99cce1f..ee2eb55 100644 --- a/iz_helpers/run.py +++ b/iz_helpers/run.py @@ -43,8 +43,8 @@ class InfZoomer: self.current_seed = self.C.seed - self.mask_width = self.width * 1//4 # was initially 512px => 128px - self.mask_height = self.height * 1//4 # was initially 512px => 128px + self.mask_width = self.width * 1//16 # was initially 512px => 128px + self.mask_height = self.height * 1//16 # was initially 512px => 128px self.num_interpol_frames = round(self.C.video_frame_rate * self.C.zoom_speed) if (self.C.outpaintStrategy == "Corners"): @@ -441,7 +441,7 @@ class InfZoomer: scaling_steps.append((math.floor(new_width), math.floor(new_height))) return scaling_steps - def interpolateFramesOuterZoom(cls,self): + def interpolateFramesOuterZoom(self): if 0 == self.C.video_zoom_mode: current_image = self.main_frames[0] @@ -451,7 +451,7 @@ class InfZoomer: raise ValueError("unsupported Zoom mode in INfZoom") self.contVW = ContinuousVideoWriter(self.out_config["video_filename"], - cls.cropCenterTo(current_image,(self.width,self.height)), + self.cropCenterTo(current_image,(self.width,self.height)), self.C.video_frame_rate,int(self.C.video_start_frame_dupe_amount)) outzoomSize = (self.width+self.mask_width*2, self.height+self.mask_height*2) @@ -471,7 +471,7 @@ class InfZoomer: current_image = self.main_frames[-1-i] self.contVW.append([ - cls.cropCenterTo(current_image,(self.width, self.height)) + self.cropCenterTo(current_image,(self.width, self.height)) ]) # interpolation steps between 2 inpainted images (=sequential zoom and crop) @@ -480,7 +480,7 @@ class InfZoomer: print (f"\033[KInfZoom: Interpolate frame: main/inter: {i}/{j} \r") #todo: howto zoomIn when writing each frame; self.main_frames are inverted, howto interpolate? scaled_image = current_image.resize(scaling_steps[j]) - cropped_image = cls.cropCenterTo(scaled_image,(self.width, self.height)) + cropped_image = self.cropCenterTo(scaled_image,(self.width, self.height)) self.contVW.append([cropped_image]) @@ -614,8 +614,7 @@ class InfZoomer: return prev_step_img - @staticmethod - def cropCenterTo(im: Image, toSize: tuple[int,int]): + def cropCenterTo(self, im: Image, toSize: tuple[int,int]): width, height = im.size left = (width - toSize[0])//2 top = (height - toSize[1])//2