GithubHelp home page GithubHelp logo

browatbn2 / 3fabrec Goto Github PK

View Code? Open in Web Editor NEW
124.0 124.0 19.0 98.35 MB

3FabRec: Fast Few-shot Face alignment by Reconstruction - PyTorch implementation

Home Page: https://arxiv.org/abs/1911.10448

License: MIT License

Python 99.71% Shell 0.29%

3fabrec's People

Contributors

browatbn2 avatar dependabot[bot] avatar guillermogotre 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  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  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  avatar  avatar  avatar  avatar  avatar

3fabrec's Issues

Using pretrained model

Hi, I am trying to use the provided model trained on 300w on a sample unseen image. However I am getting some artifacts in the reconstructions and as a result the predicted landmarks are also random.

image

image

Here is what I did:

  • Face cropped the image
  • Resized to (256, 256)
  • Normalized between (0,1) and (-1, 1) with the same result

Am I missing anything here?

Training for arbitrary number of landmarks

Hi @browatbn2

Hope all's well with you!

I have successfully trained and tested the existing pipeline of your work. I am quite excited about using it in my context. I have my own internal dataset with images having 38 landmarks on the face. I'm trying to modify your code to make it work. So far, I have prepared the annotation files in the exact format WFLW demands, and have copied and modified the wflw.py code for the specific number of landmarks. I can save the crops but as soon as training starts, the file 'landmarks/lmutils.py' throws errors. After closer inspection, I noticed that the number 68 is hardcoded at multiple places in lmutils.py.
Really hope if you could guide me with the necessary modifications! Thanks and Take Care!

The model's performance on extreme few-shot settings

Hi!
I tried to train the model with only 1 training image. I excuted the training script with the command

python3 train_aae_landmarks.py --sessionname one_shot_aae -r ./ --train-encoder 0 --dataset w300 --train-count 1 --batchsize 1 --epoch 10000 --eval-freq 1000 --save-freq 1000

However, there is still a gap between the trained model and the reported performance in the paper. I got nmes=15.20/18.11/15.93 with the above command. Did I miss any important detail when I trained this model? Or is it just simply because the epoch number is not enough?
Thanks!

Question about training with limited data

Hi,

First, thank you for sharing the repo, it is very well coded and useful.

I have a question about the results reported on the paper when training with limited data (50 samples for instance).
How did you choose the samples to train on ? Was the results based on the first 50 samples of dataset or did you average over multiple random sets ?

Thank you

Some question about the model.

Hi,
it's a great project, and I run successfully!
Can I know your demo's model trained from which dataset, and is it the best one you mentioned in your paper?

About training/validation losses

@browatbn2 Hey.
For only the unsupervised reconstruction task, have you tried looking for the training/validation losses? Just plotting the reconstruction loss for all the three steps (recon, with gan, with gan & with ssim) the losses don't seem to converge and are jittery, although the reconstruction quality improves. Can you comment on this behavior of loss curves?

Question about randomly-generated faces

Hello, I have learned a lot from reading your paper. It is an excellent job. However, I met some problems in the process of reading the paper. I hope you can help me.
1、How is Fig. 3 and Fig.4 generated? I find it is not stated more in the paper. I would like to know more about it.
2、Since it is possible to generate many different poses or styles from the original input image, can these images be used as additional data augmentation to train other supervised models ?
Thanks!

Would you like to share the pre-trained aae?

Hi!
Thanks for your great work and detailed code sharing.
I noticed that you provided a pre-trained model, and I suppose this model is trained on the full WFLW, right?
Would you like to also share the pre-trained adversarial autoencoder? Since the model seems to be very useful to train on different datasets and tasks but the data preparation and training will take several days.
I would be grateful if you can share this interesting model.
Thx!

Aflw annotations

Hi, I have some questions about AFLW annotations.

In the AFLW dataset code, you merge old and new annotations. Is the only reason to keep the "yaw, pitch, roll" keys? These keys are not used anywhere else in the code so is this operation necessary?

Also, after the merge 10 annotations are missing, the training dataset has 19993 annotations instead of 20000, and the test dataset has 4383 instead of 4886. Did you encounter this issue?

Question about the unsupervised stage training process.

Thanks for your stimulating work!

I am curious about the unsupervised training process, so I read the related source code. But there is something I cannot understand and I will describe as below:
As I can see, the parameters updating follow the procedure: L_enc for updating D_z (4 iters once) and Encoder (2 iters once); L_adv for updating D_x (2 iters once); L_rec+L_cs+L_adv for updating Encoder & Generator (1 iter once). I hope this is right. 😄
Here comes the question.
Firstly, L_enc for updating Encoder leaves gradient information coming form L_enc which is not useful afterwards but I cannot find any code zero_grad the gradient in Encoder. (The leaving gradient may even damage the training after ❔ ) Since you have done
self.saae.zero_grad()
in train_aae_unsupervised.py in line 228, I think that self.saae.P.zero_grad() in line 262 can be changed to self.saae.Q.zero_grad(). Then I think it will make sense.
Secondly, I would like to ask why the updating frequency of Discriminator is set to be slower than that of Generator?

Hope to hear from you soon~ 👍

Bug while using Pytorch 1.5

Hi @browatbn2 ! Thanks for sharing your work. I was trying to reproduce your results by training the autoencoder.
I get this error when I run python train_aae_unsupervised.py --sessionname my_model --daug 4 --input-size 256 --epoch 1

Traceback (most recent call last):
File "train_aae_unsupervised.py", line 462, in
run(args)
File "train_aae_unsupervised.py", line 403, in run
fntr.train(num_epochs=args.epochs)
File "train_aae_unsupervised.py", line 171, in train
self._run_epoch(self.datasets[TRAIN])
File "train_aae_unsupervised.py", line 214, in _run_epoch
self._run_batch(data, eval=eval)
File "train_aae_unsupervised.py", line 304, in _run_batch
loss.backward()
File "/home/aseem/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/tensor.py", line 198, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/aseem/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/autograd/init.py", line 98, in backward
Variable._execution_engine.run_backward(
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [512, 99]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

I understand that pytorch==1.1 has been tested for this version. Due to mismatch with CUDA versions and latest hardware (V100 doesn't support CUDA 10.0 while pytorch 1.1 requires cuda 10.0), I am unable to install pytorch 1.1. Please let me know if you could help out with the error. Best Regards,

Is there a pre-trained model?

hi~thanks for your work. I am very interested in it.
I want to run the demo, can you provide the trained model?
Thank you a lot!!!

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.