Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem of generating obj file with texture mapping #8

Closed
code-conquer opened this issue Dec 22, 2021 · 5 comments
Closed

Problem of generating obj file with texture mapping #8

code-conquer opened this issue Dec 22, 2021 · 5 comments

Comments

@code-conquer
Copy link

First of all, thank you very much for sharing such excellent work. I want to put the last generated texture into meshlab for analysis, so I generated an obj file, which contains 3D face vertices and corresponding faces, but there was a problem when adding 2D texture vertices and faces. The complete 2D faces index is not found. Can you tell me how to get the complete 2D texture vertices and faces? Thank you again! Looking forward to your reply!

@barisgecer
Copy link
Owner

Can you give me more insight about at which part you had this problem? Or maybe share the generated assets?

@code-conquer
Copy link
Author

    self.tcoords_full = mio.import_pickle('models/topology/tcoords_full.pkl')
    self.tcoords = mio.import_pickle('models/topology/tcoords.pkl')    
    self.mask = mio.import_pickle('models/topology/mask_full2crop.pkl')
    self.tight_mask = mio.import_pickle('models/topology/mask_full2tightcrop.pkl')
    self.template = mio.import_pickle('models/topology/all_all_all_crop_mean.pkl')
    self.lms_ind = mio.import_pickle('models/topology/all_all_all_lands_ids.pkl')

Thank you for your reply. I found that when I use 3D vertices in tcoords_full.pkl to generate obj files, the texture and geometry are not aligned. When I use tcoords.pkl and mask_full2crop.pkl to generate obj, the texture and geometry are aligned, but the texture of the ears are not included. Can you explain the role of these files? Or how to generate obj files containing ears?
in short, this code can be used to generate obj aligned with texture and geometry:
self.full_uv_vertices = self.tcoords_full.copy().points
self.full_uv_vertices[self.mask] = self.tcoords.points
Using the following code alone generates misaligned:

self.full_uv_vertices = self.tcoords_full.copy().points

@barisgecer
Copy link
Owner

You are right. The Full topology is different than the topology of the UV texture images OSTeC is generating. The reason why I preferred to exclude ears is that they are often occluded in StyleGAN space and are difficult to match correctly. Thus you need to use cropped topology to visualize properly.

@code-conquer
Copy link
Author

Okay, I get it. Thank you very much for your patient reply!

@zeta7337
Copy link

Okay, I get it. Thank you very much for your patient reply!

hello,i face the same problem.how do you fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants