Parskatt / RoMa

[CVPR 2024] RoMa: Robust Dense Feature Matching; RoMa is the robust dense feature matcher capable of estimating pixel-dense warps and reliable certainties for almost any image pair.
https://parskatt.github.io/RoMa/
MIT License
434 stars 33 forks source link

Update kde.py #23

Open ducha-aiki opened 4 months ago

ducha-aiki commented 4 months ago

Even with this fix, we have an error:

    y = torch.multinomial(x, min(max_num_cmp,x.shape[-2]), replacement=False)
RuntimeError: cannot sample n_sample > prob_dist.size(-1) samples without replacement
Parskatt commented 4 months ago

I think I was very stupid when I implemented this, let me actually run it for real.

Parskatt commented 4 months ago

I keep confusing the syntax for np.random.choice and torch.multinomial... multinomial gives you inds from some pos measure. Should be more correct now.

Parskatt commented 4 months ago

@ducha-aiki