tonyassi commited on
Commit
b28c4fe
1 Parent(s): 68d5cd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -9,6 +9,7 @@ import cv2
9
  from PIL import Image, ImageDraw
10
  import insightface
11
  from insightface.app import FaceAnalysis
 
12
 
13
  # Diffusion
14
  model_base = "runwayml/stable-diffusion-v1-5"
@@ -55,6 +56,7 @@ def face_swap(src_img, dest_img):
55
 
56
  @spaces.GPU(enable_queue=True)
57
  def greet(description,color,features,occasion,type_,face):
 
58
 
59
  # Parse input
60
  prompt = ''
@@ -80,6 +82,9 @@ def greet(description,color,features,occasion,type_,face):
80
 
81
  if(face != 'Normal'):
82
  image = face_swap(face, image)
 
 
 
83
 
84
  return image
85
 
 
9
  from PIL import Image, ImageDraw
10
  import insightface
11
  from insightface.app import FaceAnalysis
12
+ import time
13
 
14
  # Diffusion
15
  model_base = "runwayml/stable-diffusion-v1-5"
 
56
 
57
  @spaces.GPU(enable_queue=True)
58
  def greet(description,color,features,occasion,type_,face):
59
+ start = time.time()
60
 
61
  # Parse input
62
  prompt = ''
 
82
 
83
  if(face != 'Normal'):
84
  image = face_swap(face, image)
85
+
86
+ end = time.time()
87
+ print('time:', end - start)
88
 
89
  return image
90