LVD icon indicating copy to clipboard operation
LVD copied to clipboard

[kaolin][directed_distance missing]

Open tomguluson92 opened this issue 2 years ago • 2 comments

Dear author,

thank you for you release the code & paper for research! In test_LVD_MANO.py, the directed_distance function is missing in the latest Kaolin repo. Should I use chamfer_distance instead or others?

Looking forward to your reply, thank you very much!

tomguluson92 avatar Jul 18 '22 06:07 tomguluson92

@tomguluson92 , I faced the same issue and solved with these lines in "test_LVD_MANO.py":

                #d1 = torch.sqrt(directed_distance(vertices_scan_torch, vertices_smpl[0], False)).mean()
                #d2 = torch.sqrt(directed_distance(vertices_smpl[0], vertices_scan_torch, False)).mean()
                d = sided_distance(torch.unsqueeze(vertices_scan_torch,0), torch.unsqueeze(vertices_smpl[0],0))[0]
                
                #d1 = torch.cdist(vertices_scan_torch, vertices_smpl[0]).mean()
                #d2 = torch.cdist(vertices_smpl[0], vertices_scan_torch).mean()
                loss = torch.sum(d)

The fitting output looks reasonable.

Let's see if the authors can confirm this workaround :)

riccardomarin avatar Aug 08 '22 09:08 riccardomarin

@tomguluson92 , I faced the same issue and solved with these lines in "test_LVD_MANO.py":

                #d1 = torch.sqrt(directed_distance(vertices_scan_torch, vertices_smpl[0], False)).mean()
                #d2 = torch.sqrt(directed_distance(vertices_smpl[0], vertices_scan_torch, False)).mean()
                d = sided_distance(torch.unsqueeze(vertices_scan_torch,0), torch.unsqueeze(vertices_smpl[0],0))[0]
                
                #d1 = torch.cdist(vertices_scan_torch, vertices_smpl[0]).mean()
                #d2 = torch.cdist(vertices_smpl[0], vertices_scan_torch).mean()
                loss = torch.sum(d)

The fitting output looks reasonable.

Let's see if the authors can confirm this workaround :)

Thanks bro

tomguluson92 avatar Aug 12 '22 06:08 tomguluson92