LaneGCN_ref icon indicating copy to clipboard operation
LaneGCN_ref copied to clipboard

Bugs in hdmap.py

Open MccreeZhao opened this issue 3 years ago • 1 comments

In https://github.com/zhaone/LaneGCN_ref/blob/main/data/LaneGCN/hdmap.py#L176

dist = np.expand_dims(ctrs, axis=1) - np.expand_dims(ctrs, axis=0)
dist = np.sqrt((dist ** 2).sum(2))

The motivation should be calculating a distance matrix of nodes which shape is $(M,M)$, where M is the number of nodes. However, the code above will get a $(N,N,2)$ matrix, where N is the number of lanes. Therefore, the index operation in #L199 left_dist[hi[mask], wi[mask]] = 1e6 will raise a out of range error.

MccreeZhao avatar Dec 24 '21 10:12 MccreeZhao

Also, the same error happens in https://github.com/zhaone/LaneGCN_ref/blob/main/data/LaneGCN/hdmap.py#L208. The feats should be a tensor with the shape of (num of nodes, 2). However the code miss np.concatenate(feats, 0).

MccreeZhao avatar Dec 24 '21 10:12 MccreeZhao