Spaces:
Running
Running
tori29umai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -25,6 +25,10 @@ def process_image(image_path):
|
|
25 |
width = int(height * aspect_ratio)
|
26 |
image = image.resize((width, height), Image.ANTIALIAS)
|
27 |
|
|
|
|
|
|
|
|
|
28 |
# 動画のフレーム数(30fpsで5秒分)
|
29 |
fps = 30
|
30 |
duration = 5
|
@@ -33,9 +37,7 @@ def process_image(image_path):
|
|
33 |
# フレームリストを作成
|
34 |
frames = []
|
35 |
for _ in range(total_frames):
|
36 |
-
|
37 |
-
frame = np.array(image)
|
38 |
-
frames.append(frame)
|
39 |
|
40 |
# 動画保存先の一時ファイルパス
|
41 |
output_video_path = "/tmp/output_video.mp4"
|
|
|
25 |
width = int(height * aspect_ratio)
|
26 |
image = image.resize((width, height), Image.ANTIALIAS)
|
27 |
|
28 |
+
# RGBからBGRに変換(cv2はBGRを使用する)
|
29 |
+
image = np.array(image)
|
30 |
+
image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
|
31 |
+
|
32 |
# 動画のフレーム数(30fpsで5秒分)
|
33 |
fps = 30
|
34 |
duration = 5
|
|
|
37 |
# フレームリストを作成
|
38 |
frames = []
|
39 |
for _ in range(total_frames):
|
40 |
+
frames.append(image)
|
|
|
|
|
41 |
|
42 |
# 動画保存先の一時ファイルパス
|
43 |
output_video_path = "/tmp/output_video.mp4"
|