Giter Club home page Giter Club logo

cfsm's People

Contributors

liufeng2915 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cfsm's Issues

no adaface loss in source code

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?

reproducing the results

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.

Testing

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

Define paths

input_image_path = '/workspace/saransh/tinyface/Testing_Set/Gallery_Match/1_64.jpg'
model_path = 'model_4.pt'
output_dir = 'output'

Ensure the output directory exists

os.makedirs(output_dir, exist_ok=True)

Set device

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

Load the model

model = Generator()
model.load_state_dict(torch.load(model_path, map_location=device))
model.to(device)
model.eval()

Define image transformation

transform = transforms.Compose([
transforms.Resize((256, 256)), # Resize image to model input size
transforms.ToTensor(),
])

Load and preprocess input image

input_image = Image.open(input_image_path).convert('RGB')
input_tensor = transform(input_image).unsqueeze(0).to(device)

Generate output

with torch.no_grad():
output_tuple = model(input_tensor)
output_image = output_tuple[1].squeeze(0).cpu() # Access the synthesized image (out)

Save output image

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

ERROR when training with adaface

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

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.