You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use vggface2 based embedding using facenet-pytorch
Here is the code to generate:
importtorchfromfacenet_pytorchimportMTCNN, InceptionResnetV1classFaceEmbed:
'''https://github.com/timesler/facenet-pytorch'''def__init__(self):
device=torch.device('cuda:0'iftorch.cuda.is_available() else'cpu')
# If required, create a face detection pipeline using MTCNN:self.mtcnn=MTCNN(device=device)
# Create an inception resnet (in eval mode):self.resnet=InceptionResnetV1(pretrained='vggface2').eval()
defget(self, img):
# Get cropped and prewhitened image tensorimg_cropped=self.mtcnn(img)
# Calculate embedding (unsqueeze to add batch dimension)img_embedding=self.resnet(img_cropped.unsqueeze(0))
returnimg_embedding.detach().numpy().flatten()
Then using a custom inswapper, I have replaced this line
Hi,
I'm trying to use vggface2 based embedding using facenet-pytorch
Here is the code to generate:
Then using a custom inswapper, I have replaced this line
insightface/python-package/insightface/model_zoo/inswapper.py
Line 50 in da73872
to
The resulting swap (Incorrect in picture) is not at all good. Any pointers?
The text was updated successfully, but these errors were encountered: