Spaces:
Running
Running
Update app.py
Browse files
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 =
|
| 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
|