Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -236,12 +236,13 @@ class Model:
|
|
236 |
def gen_video(self, w1, w2, noise, path, frame_num=10):
|
237 |
video = imageio.get_writer(path, mode='I', fps=frame_num // 2, codec='libx264', bitrate='16M')
|
238 |
lin = np.linspace(0, 1, frame_num)
|
|
|
239 |
for i in range(0, frame_num):
|
240 |
img = self.get_img(((1 - lin[i]) * w1) + (lin[i] * w2), noise)
|
|
|
241 |
video.append_data(img)
|
242 |
for i in reversed(range(0, frame_num)):
|
243 |
-
|
244 |
-
video.append_data(img)
|
245 |
video.close()
|
246 |
|
247 |
def get_thumbnail(img):
|
|
|
236 |
def gen_video(self, w1, w2, noise, path, frame_num=10):
|
237 |
video = imageio.get_writer(path, mode='I', fps=frame_num // 2, codec='libx264', bitrate='16M')
|
238 |
lin = np.linspace(0, 1, frame_num)
|
239 |
+
frames = []
|
240 |
for i in range(0, frame_num):
|
241 |
img = self.get_img(((1 - lin[i]) * w1) + (lin[i] * w2), noise)
|
242 |
+
frames.append(img)
|
243 |
video.append_data(img)
|
244 |
for i in reversed(range(0, frame_num)):
|
245 |
+
video.append_data(frames[i])
|
|
|
246 |
video.close()
|
247 |
|
248 |
def get_thumbnail(img):
|