YANGYYYY commited on
Commit
8afe88f
1 Parent(s): 217c9f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -59,23 +59,23 @@ def transfer_video(video, transfer_style):
59
  if transfer_style == "Hayao":
60
  #output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 转换为灰度图像
61
  #os.system("wget https://huggingface.co/YANGYYYY/cartoonize/resolve/main/GeneratorV2_train_photo_Hayao_init.pt")
62
- args = parse_args_video()
63
- # 加载视频文件
64
- #video_binary = io.BytesIO(video)
65
 
66
- cap = cv2.VideoCapture(video)
67
 
68
- # 读取视频帧并保存到一个列表中
69
- video_frames = []
70
- while True:
71
- ret, frame = cap.read()
72
- if not ret:
73
- break
74
- video_frames.append(frame)
75
 
76
- # 关闭视频文件
77
- cap.release()
78
- anime_video = Predictor(args.weight).transform_video(video_frames, args.batch_size)
79
  return anime_video
80
  elif transfer_style == "Shinkai":
81
  args = parse_args()
 
59
  if transfer_style == "Hayao":
60
  #output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 转换为灰度图像
61
  #os.system("wget https://huggingface.co/YANGYYYY/cartoonize/resolve/main/GeneratorV2_train_photo_Hayao_init.pt")
62
+ # args = parse_args_video()
63
+ # # 加载视频文件
64
+ # #video_binary = io.BytesIO(video)
65
 
66
+ # cap = cv2.VideoCapture(video)
67
 
68
+ # # 读取视频帧并保存到一个列表中
69
+ # video_frames = []
70
+ # while True:
71
+ # ret, frame = cap.read()
72
+ # if not ret:
73
+ # break
74
+ # video_frames.append(frame)
75
 
76
+ # # 关闭视频文件
77
+ # cap.release()
78
+ anime_video = Predictor(args.weight).transform_video(video, args.batch_size)
79
  return anime_video
80
  elif transfer_style == "Shinkai":
81
  args = parse_args()