Spaces:
Running
Running
gavinyuan
commited on
Commit
•
e2d0b84
1
Parent(s):
ba94b0c
update: app.py
Browse files
app.py
CHANGED
@@ -314,10 +314,10 @@ def process_video(
|
|
314 |
''' Face swapping '''
|
315 |
with torch.no_grad():
|
316 |
if 'faceshifter' in fs_model_name:
|
317 |
-
output = fs_model(source_img, target)
|
318 |
target_hair_mask = trick.get_any_mask(target, par=[0, 17])
|
319 |
target_hair_mask = trick.smooth_mask(target_hair_mask)
|
320 |
-
print(output.shape, target.shape, target_hair_mask.shape)
|
321 |
output = target_hair_mask * target + (target_hair_mask * (-1.) + 1.) * output
|
322 |
output = trick.finetune_mouth(source_img, target, output)
|
323 |
elif 'simswap' in fs_model_name and 'official' not in fs_model_name:
|
|
|
314 |
''' Face swapping '''
|
315 |
with torch.no_grad():
|
316 |
if 'faceshifter' in fs_model_name:
|
317 |
+
output = fs_model(source_img, target)[0]
|
318 |
target_hair_mask = trick.get_any_mask(target, par=[0, 17])
|
319 |
target_hair_mask = trick.smooth_mask(target_hair_mask)
|
320 |
+
# print(output.shape, target.shape, target_hair_mask.shape)
|
321 |
output = target_hair_mask * target + (target_hair_mask * (-1.) + 1.) * output
|
322 |
output = trick.finetune_mouth(source_img, target, output)
|
323 |
elif 'simswap' in fs_model_name and 'official' not in fs_model_name:
|