anuragranj / coma

Convolutional Mesh Autoencoders for Generating 3D Faces
Other
454 stars 100 forks source link

Code for sampling new synthetic data #3

Closed emanhamed closed 6 years ago

emanhamed commented 6 years ago

Can you please provide the code to show an example of how to sample new synthetic data by sampling from the latent space?

Thanks in Advance.

anuragranj commented 6 years ago

I will soon write a doc on this. But this is what you need: https://github.com/anuragranj/coma/blob/master/lib/visualize_latent_space.py

This is called if you run python main.py --data data/sliced --name sliced --mode latent

and you can use the keys qwertyui to navigate forward into each dimension of the latent space and the keys asdfghjk to navigate backward. The step is decided by constant 1.01 and 0.99 in the code of visualize_latent_space.py.

anuragranj commented 6 years ago

Fixed in 643b23474659743b13839a05818873256464df2a

emanhamed commented 6 years ago

Hi @anuragranj I have tried the command you mentioned but it is showing only one mesh! either, the keys qwertyui and asdfghjk are not working! or it is not generating new synthetic data. what do you think?

Also, in the display, after decoding the latent vector and getting the reconstructed mesh. How are you getting the connectivity list for showing the final 3D face?

Thank you so much for your help

anuragranj commented 6 years ago

The demo shows how you can sample around a particular face. So, pressing those keys will sample a face that is near the original face. To see the difference, you need to press the keys multiple times to navigate far way from the original face. You can modify, lib/visualize_latent_space.py to be more flexible.

For displaying reconstructions, we use FaceData.show_mesh() from facemesh.py