lucidrains / meshgpt-pytorch

Implementation of MeshGPT, SOTA Mesh generation using Attention, in Pytorch
MIT License
700 stars 57 forks source link

A question about the code in 'meshgpt_pytorch.py' #72

Open LeeYan1 opened 5 months ago

LeeYan1 commented 5 months ago

Here is from line 1442 to line 1449 in 'meshgpt_pytorch.py': ` sos = repeat(self.sos_token, 'd -> b d', b = batch) # b, nf, d

attended_face_codes_withsos, = pack([sos, attended_face_codes], 'b * d') # b, 1+nf, d

grouped_codes = pad_to_length(grouped_codes, attended_face_codes_with_sos.shape[-2], dim = 1) # b, nf+1, n, d fine_vertexcodes, = pack([attended_face_codes_with_sos, grouped_codes], 'b n * d') # b, nf+1, 1+n, d

fine_vertex_codes = fine_vertex_codes[..., :-1, :] # b, nf+1, 1+n-1, d ` The meanings of the symbols in the comments are b for batch, nf for number of faces, d for the dimension of feature, n for the number of tokens per face respectively. And the number before or after the symbols means that the location where the dimension is added.

If my understanding above is correct, what does the variable _fine_vertexcodes mean in line 1447? And after line 1449, did the slice on variable _fine_vertexcodes mistakenly remove the features about the current face? In the other words, the slicing operation in line 1449 removes the contents of variable _groupedcodes.

Thank the author for providing the code, but also look forward to the author's answer.