Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,14 @@ def transfer_video(video, transfer_style):
|
|
60 |
#os.system("wget https://huggingface.co/YANGYYYY/cartoonize/resolve/main/GeneratorV2_train_photo_Hayao_init.pt")
|
61 |
args = parse_args_video()
|
62 |
# 加载视频文件
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
# 读取视频帧并保存到一个列表中
|
66 |
video_frames = []
|
|
|
60 |
#os.system("wget https://huggingface.co/YANGYYYY/cartoonize/resolve/main/GeneratorV2_train_photo_Hayao_init.pt")
|
61 |
args = parse_args_video()
|
62 |
# 加载视频文件
|
63 |
+
video_data = video.get_data()
|
64 |
+
|
65 |
+
# 将视频数据写入临时文件
|
66 |
+
temp_video_path = "temp_video.mp4"
|
67 |
+
with open(temp_video_path, "wb") as f:
|
68 |
+
f.write(video_data)
|
69 |
+
|
70 |
+
cap = cv2.VideoCapture(temp_video_path)
|
71 |
|
72 |
# 读取视频帧并保存到一个列表中
|
73 |
video_frames = []
|