yfeng95 / face3d

Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), 3D face representations.
2.68k stars 615 forks source link

Uv coordinates of image #35

Open TychoKoster opened 5 years ago

TychoKoster commented 5 years ago

How do I get the uv coordinates of a 3d model? I want to create a texture map from any image not just the one from the bfm model. But 7_generate_uv_map.py only generates it for the BFM example. I found this: uv_coords = face3d.morphable_model.load.load_uv_coords('Data/BFM/Out/BFM_UV.mat') attribute = uv_coords uv_coords_image = mesh_numpy.render.render_colors(image_vertices, triangles, attribute, h, w, c=2)

But this results in an array of 3 dimensions, while the texture map generation from 7_generate_uv_map.py needs a 2 dimension array. Any suggestions?

varunszapp commented 4 years ago

I have the same problem. Have you found a solution?