Skip to content

关于point_buf和顶点法线计算 #209

Description

@HITKevin
def Compute_norm(self, face_shape):

        face_id = self.tri.long()
        point_id = self.point_buf.long()
        shape = face_shape
        v1 = shape[:, face_id[:, 0], :]
        v2 = shape[:, face_id[:, 1], :]
        v3 = shape[:, face_id[:, 2], :]
        e1 = v1 - v2
        e2 = v2 - v3
        face_norm = e1.cross(e2)
        empty = torch.zeros((face_norm.size(0), 1, 3),
                            dtype=face_norm.dtype, device=face_norm.device)
        face_norm = torch.cat((face_norm, empty), 1)
        v_norm = face_norm[:, point_id, :].sum(2)
        v_norm = v_norm / v_norm.norm(dim=2).unsqueeze(2)

        return v_norm

为什么不把empty cat在前边,这样point_buf里的index也不用-1了,而且这样用0补齐(N,8)就可以了,也不会有让人难以理解的以面的个数作为占位数字补齐

Activity

  1. yuchen814 commented on Jan 29, 2023

    @yuchen814

    请问如果我想重建耳朵和脖子部分,怎么建立53215维度的point_buf啊

  2. WangXuan2401 commented on Feb 11, 2023

    @WangXuan2401

    请问如果我想重建耳朵和脖子部分,怎么建立53215维度的point_buf啊

    hello,Have you solved the problem?I met the same problem when getting full region with neck and ears, would you be nice to give me some help?
    thanks for your attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions