naver / mast3r

Grounding Image Matching in 3D with MASt3R
Other
796 stars 45 forks source link

Error in Demo #2

Closed JayKarhade closed 2 months ago

JayKarhade commented 2 months ago

Hi, I tried running the mast3r demo using the assets/NLE_tower images.

However, i get an error in the global alignment.

  File "/Users/jaykarhade/Downloads/mast3r/demo.py", line 144, in get_reconstructed_scene
    scene = sparse_global_alignment(filelist, pairs, os.path.join(outdir, 'cache'),
  File "/Users/jaykarhade/Downloads/mast3r/mast3r/cloud_opt/sparse_ga.py", line 131, in sparse_global_alignment
    pairs, cache_path = forward_mast3r(pairs_in, model,
  File "/Users/jaykarhade/exploratory/dust3r/dust3r_venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jaykarhade/Downloads/mast3r/mast3r/cloud_opt/sparse_ga.py", line 563, in forward_mast3r
    corres = extract_correspondences(descs, qonfs, device=device, subsample=subsample)
  File "/Users/jaykarhade/Downloads/mast3r/mast3r/cloud_opt/sparse_ga.py", line 621, in extract_correspondences
    nn1to2 = fast_reciprocal_NNs(A, B, subsample_or_initxy1=subsample, ret_xy=False, **opt)
  File "/Users/jaykarhade/Downloads/mast3r/mast3r/fast_nn.py", line 151, in fast_reciprocal_NNs
    _, xy2[notyet] = to_numpy(tree2.query(pts1[xy1[notyet]], **matcher_kw))
TypeError: KDTree.query() got an unexpected keyword argument 'dist'
yocabon commented 2 months ago

Hi, it looks like a device issue.

the code was tested with device='cuda' and it seems there's a bug when it's not (sparse_ga setup params for cdistMatcher but then tries to use the KDTree with the wrong params). refs https://github.com/naver/mast3r/blob/main/mast3r/cloud_opt/sparse_ga.py#L611 https://github.com/naver/mast3r/blob/main/mast3r/fast_nn.py#L141

I'll fix that tomorrow.

JayKarhade commented 2 months ago

Thanks, looking forward to it :)