tuan2308 commited on
Commit
e496964
1 Parent(s): e1e3993

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,6 @@
1
  # -*- coding:UTF-8 -*-
2
  # !/usr/bin/env python
 
3
  import numpy as np
4
  import gradio as gr
5
  import gradio.exceptions
@@ -12,13 +13,12 @@ from roop.processors.frame.core import get_frame_processors_modules
12
  from roop.utilities import normalize_output_path
13
  import os
14
  from PIL import Image
15
- import spaces
16
  import uuid
17
  import onnxruntime as ort
18
  import cv2
19
  from roop.face_analyser import get_one_face
20
 
21
- @spaces.GPU
22
  def swap_face(source_file, target_file, doFaceEnhancer):
23
  session_id = str(uuid.uuid4()) # Tạo một UUID duy nhất cho mỗi phiên làm việc
24
  session_dir = f"temp/{session_id}"
 
1
  # -*- coding:UTF-8 -*-
2
  # !/usr/bin/env python
3
+ import spaces
4
  import numpy as np
5
  import gradio as gr
6
  import gradio.exceptions
 
13
  from roop.utilities import normalize_output_path
14
  import os
15
  from PIL import Image
 
16
  import uuid
17
  import onnxruntime as ort
18
  import cv2
19
  from roop.face_analyser import get_one_face
20
 
21
+ @spaces.GPU(enable_queue=True)
22
  def swap_face(source_file, target_file, doFaceEnhancer):
23
  session_id = str(uuid.uuid4()) # Tạo một UUID duy nhất cho mỗi phiên làm việc
24
  session_dir = f"temp/{session_id}"