-
Notifications
You must be signed in to change notification settings - Fork 292
Open
Description
def swap_face(source,target,netArc,G,half=True):
target_norm = normalize_and_torch(np.array(target))
target_embeds = netArc(F.interpolate(target_norm, scale_factor=0.5, mode='bilinear', align_corners=True))
source_curr = normalize_and_torch(source)
source_embed = netArc(F.interpolate(source_curr, scale_factor=0.5, mode='bilinear', align_corners=True))
resized_image = cv2.resize(target,(256,256))
resized_frs = np.array([resized_image])
target_batch_rs = transform_target_to_torch(resized_frs, half=half)
if half:
source_embed = source_embed.half()
Y_st = faceshifter_batch(source_embed, target_batch_rs, G)
return Y_st[0]
Metadata
Metadata
Assignees
Labels
No labels