-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add random_seed to IncrementalMapper to control all RANSAC seeds for improved SfM reproducibility #3544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/colmap/exe/sfm.cc
Outdated
| options.AddDefaultOption("gpu_index", &reconstruction_options.gpu_index); | ||
| options.Parse(argc, argv); | ||
|
|
||
| reconstruction_options.random_seed = kDefaultPRNGSeed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a random_seed field to AutomaticReconstructionController::Options and appropriately passing it inside the AutomaticReconstructionController to the respective workers? Then, here we would expose it also as a commandline argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. To avoid naming conflicts, I renamed the global random_seed in OptionsManager to default_random_seed.
|
|
||
| ASSERT_EQ(reconstruction_manager0->Size(), 1); | ||
|
|
||
| // Same seed should produce similar results, up to floating-point variations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set num_threads=1, the reconstructions should be identical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added single-threaded tests. Using the same seed and single thread produces identical results.
…improved SfM reproducibility (colmap#3544) This PR introduces a `random_seed` option in IncrementalMapper that controls the random seeds used in all RANSAC processes throughout the reconstruction pipeline. This enhancement improves SfM reproducibility, facilitating debugging and consistent testing. Floating-point variations from Ceres optimization in multithreaded environments remain unavoidable. --------- Co-authored-by: StonerLing <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]>
…improved SfM reproducibility (colmap#3544) This PR introduces a `random_seed` option in IncrementalMapper that controls the random seeds used in all RANSAC processes throughout the reconstruction pipeline. This enhancement improves SfM reproducibility, facilitating debugging and consistent testing. Floating-point variations from Ceres optimization in multithreaded environments remain unavoidable. --------- Co-authored-by: StonerLing <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]>
…improved SfM reproducibility (colmap#3544) This PR introduces a `random_seed` option in IncrementalMapper that controls the random seeds used in all RANSAC processes throughout the reconstruction pipeline. This enhancement improves SfM reproducibility, facilitating debugging and consistent testing. Floating-point variations from Ceres optimization in multithreaded environments remain unavoidable. --------- Co-authored-by: StonerLing <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]>
This PR introduces a
random_seedoption in IncrementalMapper that controls the random seeds used in all RANSAC processes throughout the reconstruction pipeline. This enhancement improves SfM reproducibility, facilitating debugging and consistent testing.Floating-point variations from Ceres optimization in multithreaded environments remain unavoidable.