zju3dv / DetectorFreeSfM

Code for "Detector-Free Structure from Motion", CVPR 2024
Apache License 2.0
543 stars 27 forks source link

Slow speed #39

Open DX3906G opened 1 month ago

DX3906G commented 1 month ago

Really a great work! But when I test DetectorFreeSfM on my own dataset (100 images of 640*480), I notice that it takes more than one hour to finish the coarse matching (on a single RTX3090). In contrast, Colomap can finish it in 10 minutes. I would like to know the reason for this problem. Is there any way to optimize it? I notice that the 'img_pair_strategy' config of neuralsfm is set to 'exhaustive'. Is this related to the problem?

hxy-123 commented 1 month ago

Yes, exhaustive matching is slow especially when performing matching on a large number of images, as it constructs C_n^2 pairs. Actually, we use exhaustive matching just for following other baselines in experiments for fair comparison. In practice, you can use sequential matching if image orders are known. Moreover, you can open parallel matching to speed up the matching phase.

hxy-123 commented 1 month ago

One more thing, you can lower the image resize setting for high matching speed in your setting since your image size is 640*480 where the default image resizing param is 1200.

DX3906G commented 1 month ago

Yes, exhaustive matching is slow especially when performing matching on a large number of images, as it constructs C_n^2 pairs. Actually, we use exhaustive matching just for following other baselines in experiments for fair comparison. In practice, you can use sequential matching if image orders are known. Moreover, you can open parallel matching to speed up the matching phase.

Thanks for your kind reply! I didn't find any config related to parallel matching in the config file. Could you provide instructions on how to open it?

DX3906G commented 1 month ago

Besides, I meet another problem. In the 'colmap_coarse' result folder of my own dataset (100 images of 640*480, textureless object), the whole sequence is divided into serval subfolders, each contains a part of the sequence. What's the reason for this? image

Bin-ze commented 1 month ago

Besides, I meet another problem. In the 'colmap_coarse' result folder of my own dataset (100 images of 640*480, textureless object), the whole sequence is divided into serval subfolders, each contains a part of the sequence. What's the reason for this? image

This is because there are too few matches between frames, so it is impossible to reconstruct a unified scene. One solution is to use colmap's official alignment API to merge sub-scenes

wwj-53 commented 1 week ago

@hxy-123 @DX3906G
I set imd_pair_Strategy to sequential in dfsfm.yaml( img_pair_strategy: sequential #exhaustive sequential), It will report an error: (eval_core_ray_wrapper pid=888415) 2024-07-15 10:49:06.431 | ERROR | main:eval_core_ray_wrapper:93 - Error captured: (eval_core_ray_wrapper pid=888412) 2024-07-15 10:49:06.430 | INFO | main:eval_core:36 - Worker: 1 will process: [], total: 0 scenes Setting it to exhaustive will not result in errors, but it runs very, very slowly. How should I make changes? Thank you!