We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 383808d commit 3c1d071Copy full SHA for 3c1d071
run_tokenflow_pnp.py
@@ -1,6 +1,5 @@
1
import glob
2
import os
3
-import re
4
import numpy as np
5
import cv2
6
from pathlib import Path
@@ -117,8 +116,7 @@ def get_latents_path(self):
117
116
Path(config["data_path"]).stem, f'steps_{config["n_inversion_steps"]}')
118
latents_path = [x for x in glob.glob(f'{latents_path}/*') if '.' not in Path(x).name]
119
120
- pattern = re.compile(".*nframes_([0-9]+)")
121
- n_frames = [int(g[1]) for g in [pattern.match(latents_path[i]) for i in range(len(latents_path))] if g]
+ n_frames = [int(os.path.basename(x).split('')[1]) for x in latents_path if 'nframes' in x]
122
123
latents_path = latents_path[np.argmax(n_frames)]
124
self.config["n_frames"] = min(max(n_frames), config["n_frames"])
0 commit comments