tuan2308 commited on
Commit
324786c
1 Parent(s): 8725ec6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,6 +13,7 @@ import os
13
  from PIL import Image
14
  import spaces
15
  import uuid
 
16
 
17
  @spaces.GPU
18
  def swap_face(source_file, target_file, doFaceEnhancer):
@@ -43,7 +44,7 @@ def swap_face(source_file, target_file, doFaceEnhancer):
43
  video_encoder = "libx264"
44
  video_quality = 18
45
  max_memory = "4G"
46
- execution_providers = decode_execution_providers(["cuda"])
47
  execution_threads = 4
48
  reference_face_position = 0
49
  similar_face_distance = 0.6
 
13
  from PIL import Image
14
  import spaces
15
  import uuid
16
+ import onnxruntime
17
 
18
  @spaces.GPU
19
  def swap_face(source_file, target_file, doFaceEnhancer):
 
44
  video_encoder = "libx264"
45
  video_quality = 18
46
  max_memory = "4G"
47
+ execution_providers = ["CUDAExecutionProvider", "CPUExecutionProvider"] # Ưu tiên GPU, sau đó là CPU
48
  execution_threads = 4
49
  reference_face_position = 0
50
  similar_face_distance = 0.6