HavenFeng/photometric_optimization

Question about texture_mean and texture_basis

flynnamy opened this issue · 4 comments

Hi, I could not find texture_mean_image_completed.npy and texture_basis_image_completed.npy in FLAME project. Could you please share them or add them into FLAME project? Thx! @HavenFeng

same question,not found

D0miH commented

Hey,

so I looked into the code and I think you can calculate/get those numpy arrays on your own.
Here is what I did:

  1. Get the Texture space from the official FLAME website
  2. Extract the zip file and execute the following script:
import numpy as np
tex_space = np.load('./FLAME_texture.npz')
tex_mean = tex_space['mean']
tex_basis = tex_space['tex_dir']
np.save('./texture_mean_image_completed.npy', np.reshape(tex_mean, (1, -1)))
np.save('./texture_basis_images_completed.npy', np.reshape(tex_basis, (-1, 200))[:, :50])

This should generate the necessary files. Keep in mind that only the 50 first principal components of the texture space are used by default. If you want to use all 200 principle components of the texture space just remove the [:, :50] above and exchange the value of tex_params at the beginning of the __main__ function with the value of 200.

Thanks for pointing it out. It's a version legacy issue, I've adapted the codes to FLAME_texture.npz as input, also fixed a texture space color range bug.

wwdok commented

Could anyone tell me where to download the FLAME_texture.npz, is it one of the two :
image