Skip to content
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

Add support to run multiple correspondence generator before 2-view estimation #663

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ayushbaid
Copy link
Contributor

No description provided.

Comment on lines +244 to +310
# TODO(Handle this)
# process_graph_generator = ProcessGraphGenerator()
# if isinstance(self.scene_optimizer.correspondence_generator, ImageCorrespondenceGenerator):
# process_graph_generator.is_image_correspondence = True
# process_graph_generator.save_graph()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepanyanhayk How should I handle having multiple correspondence generators?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we have multiple correspondence generator, I cannot use the single flag to control the process graph generation. I need to upgrade the process graph generator too.

@ayushbaid ayushbaid force-pushed the feature/multiple-corr-generator branch from 017f9c4 to 1a76943 Compare January 2, 2024 01:48
@ayushbaid
Copy link
Contributor Author

Metrics on 01/02: visual_comparison_dashboard.zip

@travisdriver
Copy link
Collaborator

Some unit tests failing to do FAILED tests/test_gtsfm_runner_olssonloader.py::test_gtsfm_runner_olssonloader[dataset_path0] - hydra.errors.MissingConfigException: Cannot find primary config 'sift_front_end.yaml'. Check that it's in your config search path.

Comment on lines 15 to 29
# config dataset lookahead img-extension source loader max-res share-intrinsics append-sift
[sift, door-12, 15, JPG, test_data, olsson-loader, 1296, true, false ],
[lightglue, door-12, 15, JPG, test_data, olsson-loader, 1296, true, true ],
[sift, skydio-8, 15, jpg, gdrive , colmap-loader, 760, true, false ],
[lightglue, skydio-8, 15, jpg, gdrive, colmap-loader, 760, true, true ],
[sift, skydio-32, 15, jpg, gdrive, colmap-loader, 760, true, false ],
[lightglue, skydio-32, 15, jpg, gdrive, colmap-loader, 760, true, true ],
[sift, palace-fine-arts-281, 15, jpg, wget, olsson-loader, 320, true, false ],
[lightglue, notre-dame-20, 15, jpg, gdrive, colmap-loader, 760, false, true ],
[sift, 2011205_rc3, 15, png, wget, astrovision, 1024, true, false ],
[lightglue, 2011205_rc3, 15, png, wget, astrovision, 1024, true, true ],
[sift, gerrard-hall-100, 15, jpg, wget, colmap-loader, 760, true, false ],
[lightglue, gerrard-hall-100, 15, jpg, wget, colmap-loader, 760, true, true ],
[sift, south-building-128, 15, jpg, wget, colmap-loader, 760, true, false ],
[lightglue, south-building-128, 15, jpg, wget, colmap-loader, 760, true, true ],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these all false for now

Comment on lines +19 to +32
correspondence_generators:
- _target_: gtsfm.frontend.correspondence_generator.det_desc_correspondence_generator.DetDescCorrespondenceGenerator

detector_descriptor:
_target_: gtsfm.frontend.cacher.detector_descriptor_cacher.DetectorDescriptorCacher
detector_descriptor_obj:
_target_: gtsfm.frontend.detector_descriptor.sift.SIFTDetectorDescriptor
max_keypoints: 5000
detector_descriptor:
_target_: gtsfm.frontend.cacher.detector_descriptor_cacher.DetectorDescriptorCacher
detector_descriptor_obj:
_target_: gtsfm.frontend.detector_descriptor.sift.SIFTDetectorDescriptor
max_keypoints: 5000

matcher:
_target_: gtsfm.frontend.cacher.matcher_cacher.MatcherCacher
matcher_obj:
_target_: gtsfm.frontend.matcher.twoway_matcher.TwoWayMatcher
ratio_test_threshold: 0.8
matcher:
_target_: gtsfm.frontend.cacher.matcher_cacher.MatcherCacher
matcher_obj:
_target_: gtsfm.frontend.matcher.twoway_matcher.TwoWayMatcher
ratio_test_threshold: 0.8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the extra indent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because now correspondence_generators is a list. You'll notice an extra - at line 20. Each entry is an item in the list too.

Comment on lines +351 to +353
) = correspondence_utils.merge_correspondences(
keypoints_from_all_corr_generators,
putatutive_corr_idxs_from_all_corr_generators,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there's only one generator?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid calling this unless generators > 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the function will be a no-op and just return early if we have just 1 correspondence generator. Leaving it as is.

@travisdriver
Copy link
Collaborator

It looks like you deleted a couple of the front-end configs. Did you mean to do that?

@ayushbaid
Copy link
Contributor Author

It looks like you deleted a couple of the front-end configs. Did you mean to do that?

I thought everything used unified, but apparently not. Let me revert.

@johnwlambert
Copy link
Collaborator

CI is failing btw

# config dataset lookahead img-extension source loader max-res share-intrinsics append-sift
[sift, door-12, 15, JPG, test_data, olsson-loader, 1296, true, false],
[lightglue, door-12, 15, JPG, test_data, olsson-loader, 1296, true, false],
[sift, skydio-8, 15, jpg, wget , colmap-loader, 760, true, false],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw I think the indentation is uneven on this line

)


def merge_correspondences(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a unit test for this?

from gtsfm.common.keypoints import Keypoints


def merge_keypoints(keypoints_1: Keypoints, keypoints_2: Keypoints) -> Tuple[Keypoints, int]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a unit test for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants