ConditionalVAE icon indicating copy to clipboard operation
ConditionalVAE copied to clipboard

Pretrained Model

Open bytosaur opened this issue 4 years ago • 6 comments

Hey EleMisi,

great work! I am looking into real-time face-manipulation using TensorFlow 2... Did you try using higher resolutions, say 128x128? Do you happen to have a SavedModel, checkpoints or h5 weights for it? If not, how long does the training take?

many thanks :)

bytosaur avatar Apr 01 '21 12:04 bytosaur

Hi bytosaur,

Thank you very much!

Your project sounds really interesting, here you are the saved model: SavedModel.zip We tried only with 64x64 resolution, and with the following configuration the training took around 430 sec per epoch:

# Hyper-params
label_dim = 40
image_dim = [64, 64, 3]
latent_dim = 128
beta = 0.65

# Training configuration
learning_rate = 0.001
train_size = 0.7
n_epochs = 30
batch_size = 32

Let me know if I can help you, and stay safe 🍀

EleMisi

EleMisi avatar Apr 01 '21 13:04 EleMisi

Awesome! The SavedModel is exactly what i needed! I ll come back to you once my experiments are done :)

bytosaur avatar Apr 01 '21 14:04 bytosaur

Perfect! ☀️

EleMisi avatar Apr 01 '21 19:04 EleMisi

Ou looks like that's a checkpoint. I'll either try to convert to SavedModel (currently struggeling) or train it myself and export as SavedModel. Nevertheless, the code looks promising for what i have in mind :) I think the __ call__() function should be named call(). As described here.

bytosaur avatar Apr 02 '21 11:04 bytosaur

Yes, we saved only the checkpoint, but the source code of our model is available here and you can load the parameter values that I gave you by using the "Checkpoint" section of this notebook. At this point it should be quite easy for you to save the model since it is a tf.keras.Module subclass ( as described here) 😊

EleMisi avatar Apr 02 '21 13:04 EleMisi

Hey there! Sorry for no response for a 2 weeks. There were a few things which prohibited the export as a saveModel. I tried to fix those issues in this fork and cleanup the model as good as i could. I am pretty sure there are still some flaws but I havent have time yet. I first need to play around with the real time face manipulations. I'll let u know when i come across something cool. Thanks for sharing the code :) If u find some time let me know what you think of the changes - i hope i didnt screw up the math

bytosaur avatar Apr 16 '21 13:04 bytosaur