facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

Why is only ind[0] appended here? #1881

Closed fei1lee closed 3 weeks ago

fei1lee commented 1 month ago

When using the Co3D dataset, if a batch loads two frames from the same sequence, they use the same point cloud, resulting in two identical pointcloud_ids https://github.com/facebookresearch/pytorch3d/blob/fca83e6369e62de2736763372a2de949d56d5a74/pytorch3d/implicitron/dataset/frame_data.py#L407. When it reaches https://github.com/facebookresearch/pytorch3d/blob/fca83e6369e62de2736763372a2de949d56d5a74/pytorch3d/implicitron/dataset/frame_data.py#L407, the length of ind is greater than 1. If sequence_point_cloud only appends the point cloud from ind[0], it will cause the batch_size of sequence_point_cloud in the final FrameData to be inconsistent with other data. Is this a bug?

bottler commented 3 weeks ago

I think this is deliberate, to avoid wasting memory on multiple copies of the same data.