Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,8 @@ app = FaceAnalysis(name='buffalo_l')
|
|
25 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
26 |
|
27 |
|
28 |
-
def face_swap(dest_img):
|
29 |
-
src_img = Image.open('./images/
|
30 |
|
31 |
# Convert to RGB
|
32 |
src_img = src_img.convert(mode='RGB')
|
@@ -77,7 +77,8 @@ def greet(description,color,features,occasion,type_,face):
|
|
77 |
cross_attention_kwargs={"scale": 1.0}
|
78 |
).images[0]
|
79 |
|
80 |
-
|
|
|
81 |
|
82 |
return image
|
83 |
|
|
|
25 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
26 |
|
27 |
|
28 |
+
def face_swap(src_img, dest_img):
|
29 |
+
src_img = Image.open('./images/' + src_img + '.JPG')
|
30 |
|
31 |
# Convert to RGB
|
32 |
src_img = src_img.convert(mode='RGB')
|
|
|
77 |
cross_attention_kwargs={"scale": 1.0}
|
78 |
).images[0]
|
79 |
|
80 |
+
if(face != 'Normal'):
|
81 |
+
image = face_swap(face, image)
|
82 |
|
83 |
return image
|
84 |
|