naver / mast3r

Grounding Image Matching in 3D with MASt3R
Other
786 stars 43 forks source link

best configuration for reconstructing from >100 images #21

Open zcczhang opened 1 month ago

zcczhang commented 1 month ago

Hi authors, thank you for bringing such a great project out!

For reconstructing scenes with hundreds of images (like a video in the wild), what are the best configurations for the reconstruction? Would the symmetrizing and "complete" scene graph give too many pairs?

Before, in DUSt3R, I could subsample a small ratio from n*(n-1) pairs and do the reconstruction, and the results looked great, but in MASt3R, it will throw the key error here due to the subsampled pairs.

yocabon commented 1 month ago

Hi, we are still in the process of improving the sparse_ga for large image collections. that being said, it should still work with a subsample of pairs: logwin would be recommended (to have short and long range connections between images). I do not know why you are getting an error, could you tell me more ?

zcczhang commented 1 month ago

yeah I've tried with logwin with a few different window sizes and seems the results are not as good as using much fewer images, but that may also be due to the other fitting parameters.

In terms of the error, here is the pseudocode I used:

subsample_pair_ratio = 0.1
pairs = make_pairs(imgs, scene_graph="complete", prefilter=None, symmetrize=True)
n_pairs =  int(len(pairs) * subsample_pair_ratio)
pairs = random.sample(pairs, n_pairs)

and the do sparse_global_alignment( filelist, pairs, , ... ) for alignment. Then the code I pointed before will raise the Keyerror for is_matching_ok[img1, img2]:, where I am guessing that's just the unsampled/unused image pairs?

yocabon commented 1 month ago

The error most likely come from you breaking the symmetry (having both img1, img2 and img2, img1 in the pairs) when you do random.sample(pairs, n_pairs).

zcczhang commented 1 month ago

Yeah I thought so but seems to raise the same error even passing symmetrize=False

yocabon commented 1 month ago

and did you reapply symmetry after random.sample ? - pairs += [(img2, img1) for img1, img2 in pairs]

zcczhang commented 1 month ago

this will work for both symmetrize=False and True, but it should only make sense symmetrize=False for making pairs right? Why this will happen? And does DUSt3R also need to do the same thing?