naver / mast3r

Grounding Image Matching in 3D with MASt3R
Other
1.3k stars 98 forks source link

Pairview mode in Mast3r #1

Closed lck666666 closed 3 months ago

lck666666 commented 3 months ago
images = load_images([image1, image2], size=512)
output = inference([tuple(images)], model, device, batch_size=batch_size)
scene = global_aligner(output, device=device, mode=GlobalAlignerMode.PairViewer)

Hi, I tried the same pairviewer mode in Dust3r which works for only two input images, but it has the below error:

scene = global_aligner(output, device=device, mode=GlobalAlignerMode.PairViewer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xxx/mast3r/dust3r/dust3r/cloud_opt/init.py", line 29, in global_aligner net = PairViewer(view1, view2, pred1, pred2, **optim_kw).to(device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xxx/mast3r/dust3r/dust3r/cloud_opt/pair_viewer.py", line 26, in init assert self.is_symmetrized and self.n_edges == 2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError

lck666666 commented 3 months ago

oh, I just found that I need to add

pairs = make_pairs(images, scene_graph='complete', prefilter=None, symmetrize=True)

before run

output = inference(pairs, model, device, batch_size=batch_size)

It works now.