profaker commited on
Commit
ad61526
·
verified ·
1 Parent(s): 91d18ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -40,11 +40,10 @@ def frames_to_video(frame_folder, video_path, image_path, frame_count,fps):
40
 
41
  fourcc = cv2.VideoWriter_fourcc(*'mp4v')
42
  out = cv2.VideoWriter(video_path, fourcc, fps, (width, height))
43
- num_gpus = 3 # Adjust based on the number of GPUs you have
44
- providers = [f"CUDAExecutionProvider:{i}" for i in range(num_gpus)]
45
- apps = [insightface.app.FaceAnalysis(name='buffalo_l', providers=[provider]) for provider in providers]
46
- swappers = [insightface.model_zoo.get_model("inswapper_128.onnx", download=False, download_zip=False, providers=[provider]) for provider in providers]
47
- face_enhancers = [gfpgan.GFPGANer(model_path="GFPGANv1.4.pth", upscale=1, device=f'cuda:{i}') for i in range(num_gpus)]
48
 
49
  for i in tqdm(range(frame_count), desc="Converting frames to video"):
50
  print("Progress:",progress)
 
40
 
41
  fourcc = cv2.VideoWriter_fourcc(*'mp4v')
42
  out = cv2.VideoWriter(video_path, fourcc, fps, (width, height))
43
+ providers = ["CUDAExecutionProvider"]
44
+ apps = insightface.app.FaceAnalysis(name='buffalo_l', providers=[provider])
45
+ swappers = insightface.model_zoo.get_model("inswapper_128.onnx", download=False, download_zip=False, providers=[provider])
46
+ face_enhancers = gfpgan.GFPGANer(model_path="GFPGANv1.4.pth", upscale=1, device='cuda')
 
47
 
48
  for i in tqdm(range(frame_count), desc="Converting frames to video"):
49
  print("Progress:",progress)