YANGYYYY commited on
Commit
bb19505
·
verified ·
1 Parent(s): 1bd26eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -60,14 +60,9 @@ 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
- 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 = []
 
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_binary = io.BytesIO(video)
 
 
 
 
 
64
 
65
+ cap = cv2.VideoCapture(video_binary)
66
 
67
  # 读取视频帧并保存到一个列表中
68
  video_frames = []