Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -6,6 +6,7 @@ from PIL import Image
|
|
6 |
from pydub import AudioSegment
|
7 |
# Import everything needed to edit video clips
|
8 |
from moviepy.editor import *
|
|
|
9 |
|
10 |
#path = "/content/gdrive/My Drive/AI/sample_imgs/"
|
11 |
#dirs = os.listdir( path )
|
@@ -17,8 +18,8 @@ def resize(img_list):
|
|
17 |
for item in img_list:
|
18 |
im = Image.open(item)
|
19 |
imResize = im.resize((256,256), Image.ANTIALIAS)
|
20 |
-
resize_img_list.append(imResize)
|
21 |
-
print(resize_img_list)
|
22 |
return resize_img_list
|
23 |
|
24 |
#def resize():
|
@@ -46,8 +47,8 @@ def resize(img_list):
|
|
46 |
def merge_audio_video(fps, resize_img_list, speech):
|
47 |
print("** inside merge aud vid **")
|
48 |
#String a list of images into a video and write to memory
|
49 |
-
print(resize_img_list)
|
50 |
print(type(resize_img_list))
|
|
|
51 |
print(fps)
|
52 |
clip = moviepy.video.io.ImageSequenceClip.ImageSequenceClip(resize_img_list, fps=fps)
|
53 |
clip.write_videofile('my_vid_tmp.mp4')
|
|
|
6 |
from pydub import AudioSegment
|
7 |
# Import everything needed to edit video clips
|
8 |
from moviepy.editor import *
|
9 |
+
import numpy as np
|
10 |
|
11 |
#path = "/content/gdrive/My Drive/AI/sample_imgs/"
|
12 |
#dirs = os.listdir( path )
|
|
|
18 |
for item in img_list:
|
19 |
im = Image.open(item)
|
20 |
imResize = im.resize((256,256), Image.ANTIALIAS)
|
21 |
+
resize_img_list.append(np.array(imResize))
|
22 |
+
print(type(resize_img_list[0]))
|
23 |
return resize_img_list
|
24 |
|
25 |
#def resize():
|
|
|
47 |
def merge_audio_video(fps, resize_img_list, speech):
|
48 |
print("** inside merge aud vid **")
|
49 |
#String a list of images into a video and write to memory
|
|
|
50 |
print(type(resize_img_list))
|
51 |
+
print(type(resize_img_list[0]))
|
52 |
print(fps)
|
53 |
clip = moviepy.video.io.ImageSequenceClip.ImageSequenceClip(resize_img_list, fps=fps)
|
54 |
clip.write_videofile('my_vid_tmp.mp4')
|