liufeng2915 / cfsm Goto Github PK
View Code? Open in Web Editor NEWControllable and Guided Face Synthesis for Unconstrained Face Recognition (ECCV 2022)
Home Page: http://cvlab.cse.msu.edu/project-cfsm.html
License: MIT License
Controllable and Guided Face Synthesis for Unconstrained Face Recognition (ECCV 2022)
Home Page: http://cvlab.cse.msu.edu/project-cfsm.html
License: MIT License
Hi, I didnt find any code about adaface loss in your training source code for pretrained adaface AdaFace + CFSM model. Can you provide adaface loss source code for that model?
The readme for CFSM model is hard to understand in the training with custom dataset part, can you also provide the custom dataset config for it too?
Hi, your work is very interesting and enlightens me a lot.
The get_model (from backbones import get_model) function is not available in your released source code.
Thanks for the great work and comprehensive repository.
I tried to reproduce the results (FR part). Still, after training (FR backbone is being trained from scratch, and for the generator, I used the pre-trained weights of WiderFace from the repository), the results on Tinyface are lower than what is reported on the paper and also lower than the performance of the pre-trained R50 from the repository?
Am I missing something?
I appreciate any help you can provide.
When i use the following testing-generation script i am facing that issue.
import torch
from PIL import Image
import os
import torchvision.transforms as transforms
from synthesis_network import Generator # Import the Generator model from synthesis_network.py
input_image_path = '/workspace/saransh/tinyface/Testing_Set/Gallery_Match/1_64.jpg'
model_path = 'model_4.pt'
output_dir = 'output'
os.makedirs(output_dir, exist_ok=True)
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = Generator()
model.load_state_dict(torch.load(model_path, map_location=device))
model.to(device)
model.eval()
transform = transforms.Compose([
transforms.Resize((256, 256)), # Resize image to model input size
transforms.ToTensor(),
])
input_image = Image.open(input_image_path).convert('RGB')
input_tensor = transform(input_image).unsqueeze(0).to(device)
with torch.no_grad():
output_tuple = model(input_tensor)
output_image = output_tuple[1].squeeze(0).cpu() # Access the synthesized image (out)
output_image_path = os.path.join(output_dir, 'synthesized_image.jpg')
transforms.ToPILImage()(output_image).save(output_image_path)
print(f"Synthesized image saved at: {output_image_path}")
Missing key(s) in state_dict: "encoder.model.1.weight", "encoder.model.1.bias", "encoder.model.4.weight", "encoder.model.4.bias", "encoder.model.7.weight", "encoder.model.7.bias", "encoder.model.10.block.1.weight", "encoder.model.10.block.1.bias", "encoder.model.10.block.5.weight", "encoder.model.10.block.5.bias", "encoder.model.11.block.1.weight", "encoder.model.11.block.1.bias", "encoder.model.11.block.5.weight", "encoder.model.11.block.5.bias", "encoder.model.12.block.1.weight", "encoder.model.12.block.1.bias", "encoder.model.12.block.5.weight", "encoder.model.12.block.5.bias", "decoder.model.0.block.1.weight", "decoder.model.0.block.1.bias", "decoder.model.0.block.2.running_mean", "decoder.model.0.block.2.running_var", "decoder.model.0.block.5.weight", "decoder.model.0.block.5.bias", "decoder.model.0.block.6.running_mean", "decoder.model.0.block.6.running_var", "decoder.model.1.block.1.weight", "decoder.model.1.block.1.bias", "decoder.model.1.block.2.running_mean", "decoder.model.1.block.2.running_var", "decoder.model.1.block.5.weight", "decoder.model.1.block.5.bias", "decoder.model.1.block.6.running_mean", "decoder.model.1.block.6.running_var", "decoder.model.2.block.1.weight", "decoder.model.2.block.1.bias", "decoder.model.2.block.2.running_mean", "decoder.model.2.block.2.running_var", "decoder.model.2.block.5.weight", "decoder.model.2.block.5.bias", "decoder.model.2.block.6.running_mean", "decoder.model.2.block.6.running_var", "decoder.model.4.weight", "decoder.model.4.bias", "decoder.model.5.gamma", "decoder.model.5.beta", "decoder.model.8.weight", "decoder.model.8.bias", "decoder.model.9.gamma", "decoder.model.9.beta", "decoder.model.12.weight", "decoder.model.12.bias", "decoder.mlp.model.0.weight", "decoder.mlp.model.0.bias", "decoder.mlp.model.2.weight", "decoder.mlp.model.2.bias", "decoder.mlp.model.4.weight", "decoder.mlp.model.4.bias", "pca.U", "pca.mu".
Unexpected key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "bn1.num_batches_tracked", "prelu.weight", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.bn1.num_batches_tracked", "layer1.0.conv1.weight", "layer1.0.bn2.weight", "layer1.0.bn2.bias", "layer1.0.bn2.running_mean", "layer1.0.bn2.running_var", "layer1.0.bn2.num_batches_tracked", "layer1.0.prel
Something wrong in your code?
`
File "/u02/thanhtm/tmp/CFSM/GuidedFaceRecognition/losses.py", line 91, in forward
m_arc.scatter_(1, label[index, None], 1.0)
RuntimeError: Index tensor must have the same number of dimensions as self tensor
`
Thank you for the great work.
I noticed that the training code of CFSM is failing with the input size 112 with the following error:
ValueError: Expected more than 1 spatial element when training, got input size torch.Size([32, 512, 1, 1])
Apparently, it's coming from the InstanceNorm2d https://github.com/liuf1990/CFSM/blob/main/CFSM/synthesis_network.py#L200
Any advice on how to solve it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.