From 4c1af15a64b01ee70d5b994e22f5a105e2f98aec Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Sun, 15 Jan 2023 16:54:28 +0100 Subject: [PATCH] statedict export --- latent_blending.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/latent_blending.py b/latent_blending.py index 0958b8d..6412604 100644 --- a/latent_blending.py +++ b/latent_blending.py @@ -802,11 +802,16 @@ class LatentBlending(): for i, img in enumerate(imgs_transition): img_leaf = Image.fromarray(img) img_leaf.save(os.path.join(dp_img, f"lowres_img_{str(i).zfill(4)}.jpg")) - + + fp_yml = os.path.join(dp_img, "lowres.yaml") + self.save_statedict(fp_yml) + + + def save_statedict(self, fp_yml): # Dump everything relevant into yaml state_dict = self.get_state_dict() state_dict['nmb_images'] = len(imgs_transition) - yml_save(os.path.join(dp_img, "lowres.yaml"), state_dict) + yml_save(fp_yml, state_dict) def get_state_dict(self): state_dict = {} @@ -1034,7 +1039,6 @@ def add_frames_linear_interp( return list_imgs list_imgs_float = [img.astype(np.float32) for img in list_imgs] - # Distribute missing frames, append nmb_frames_to_insert(i) frames for each frame mean_nmb_frames_insert = nmb_frames_missing/nmb_frames_diff constfact = np.floor(mean_nmb_frames_insert)