elvisyjlin / AttGAN-PyTorch

AttGAN PyTorch Arbitrary Facial Attribute Editing: Only Change What You Want
MIT License
250 stars 61 forks source link

How to predict label and θ when testing #12

Closed c1a1o1 closed 5 years ago

c1a1o1 commented 5 years ago

How to predict label and θ when testing

elvisyjlin commented 5 years ago

To predict labels from D, you can achieve it by

import torch
_, logits = attgan.D(img)
predictions = torch.sigmoid(logits)

As for the θ, Extension for Attribute Style Manipulation is not implemented. You will find no θ here.

However, in my implementation, only weights of G is saved. It is not feasible to predict labels from my pretrained weights. You have to change this line from saveG() to save() and train a model yourself to get a good D.

c1a1o1 commented 5 years ago

Thank you very much!