THU-DA-6D-Pose-Group / GDR-Net

GDR-Net: Geometry-Guided Direct Regression Network for Monocular 6D Object Pose Estimation. (CVPR 2021)
https://github.com/THU-DA-6D-Pose-Group/GDR-Net
Apache License 2.0
266 stars 46 forks source link

Fix model point sampling in data_loader #104

Closed goodfella47 closed 1 year ago

goodfella47 commented 1 year ago

This pull request addresses a bug in the model point selection process, where the original implementation always selected the first NUM_PM_POINTS from the model, despite shuffling. The shuffling only affected the first indices, leading to a biased selection of model points. The updated code ensures that a random and unbiased subset of points is selected.

wangg12 commented 1 year ago

Thanks for the fix! @goodfella47 Do you have any experience of how much it affects the performance?

goodfella47 commented 1 year ago

Hi @wangg12,
I stumbled upon this bug while training the model on my custom dataset. It primarily affects rotation predictions, particularly when the mesh has a large number of vertex points. In my case, the Point-Matching loss converged, but the predicted rotation matrices were significantly off because the matching occurred between points from a small area of the mesh, as shown in red in the image below.

I haven't had the opportunity to test it on benchmark datasets, but I have tried sampling points from several benchmark meshes before and after the bug fix. The sampled points before the fix are shown in red, and those after the fix are in white. As you can see, there is a chance that the performance was affected for some meshes.

wangg12 commented 1 year ago

Thanks! This is helpful!