GAP-LAB-CUHK-SZ / Total3DUnderstanding

Implementation of CVPR'20 Oral: Total3DUnderstanding: Joint Layout, Object Pose and Mesh Reconstruction for Indoor Scenes from a Single Image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in mgnet dataloader?

aluo-x opened this issue · comments

It seems like the use of the cKDTree here when performing query is incorrect. I believe the indicies are for the original points, not relative to the distance matrix produced. So np.max(dists**2, axis=1) is sufficient.

Hi,

This step is to generate the adaptive local density of each gt point (defined with a max-min distance on all point pairs neighboring to a gt point).

I was under the impression that np.max(dist**2, axis=1) already performs the max-min distance. And the use of indicies is not necessary.

My understanding:

import numpy as np
from scipy.spatial import cKDTree

origpt = np.random.uniform(200, 3)
# Ground truth, 200 points, of dimension 3

querypt = np.random.uniform(100,3)
# Points we query, 100 points, of dimension 3

tree = cKDTree(origpt)
dd, ii = tree.query(querypt, k=10)

# dd is of shape(100, 10), gives distance of closest 10 points in origpts
# Since in mgnet, the querypt are the origpt, taking np.max(dd**2, axis=1) gives us the max-min

Hi,

Lets have a point p0 in origpt. I see your understanding here is to get the maximal distance from the k neighbors of p0 to p0 itself. But actually it does not indicate any 'density'. It only means the farthest distance to p0 in its local area. Imagine if we set the radius of the neighborhood to a very large scale.

I demonstrate an example below to explain our implementation.
demonstration

That is very clever. My understanding is mistaken, and I apologize for taking up your time.

Thanks for taking the time to explain your implementation, it makes a lot of sense.