【pytorch】Deepfake(深度换脸)-基于自编码器的Pytorch&keras完整代码实现
Pytorchimporttorchimporttorch.utils.datafromtorchimportnn,optimfrompadding_same_convimportConv2ddeftoTensor(img):img=torch.from_numpy(img.transpose((0,3,1,2)))returnimgdefvar_to_np(img_var):returnimg_