-
Notifications
You must be signed in to change notification settings - Fork 52
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
2 stage filtering in ViewGraphEstimator #739
Changes from all commits
95c730f
4cb9bbd
feaa8ee
18af06b
2ce146e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,15 @@ | |
from gtsfm.common.keypoints import Keypoints | ||
from gtsfm.common.pose_prior import PosePrior | ||
from gtsfm.common.sfm_track import SfmTrack2d | ||
from gtsfm.common.two_view_estimation_report import TwoViewEstimationReport | ||
from gtsfm.data_association.cpp_dsf_tracks_estimator import CppDsfTracksEstimator | ||
from gtsfm.data_association.data_assoc import DataAssociation | ||
from gtsfm.evaluation.metrics import GtsfmMetricsGroup | ||
from gtsfm.view_graph_estimator.cycle_consistent_rotation_estimator import ( | ||
CycleConsistentRotationViewGraphEstimator, | ||
EdgeErrorAggregationCriterion, | ||
) | ||
from gtsfm.view_graph_estimator.view_graph_estimator_base import ViewGraphEstimatorBase | ||
from gtsfm.data_association.cpp_dsf_tracks_estimator import CppDsfTracksEstimator | ||
from gtsfm.common.two_view_estimation_report import TwoViewEstimationReport | ||
|
||
|
||
class MultiViewOptimizer: | ||
|
@@ -44,6 +48,10 @@ def __init__( | |
self.ba_optimizer = bundle_adjustment_module | ||
self._run_view_graph_estimator: bool = self.view_graph_estimator is not None | ||
|
||
self.view_graph_estimator_v2 = CycleConsistentRotationViewGraphEstimator( | ||
edge_error_aggregation_criterion=EdgeErrorAggregationCriterion.MEDIAN_EDGE_ERROR | ||
) | ||
|
||
def __repr__(self) -> str: | ||
return f""" | ||
MultiviewOptimizer: | ||
|
@@ -114,6 +122,21 @@ def create_computation_graph( | |
two_view_reports_dict, | ||
debug_output_dir, | ||
) | ||
( | ||
viewgraph_i2Ri1_graph, | ||
viewgraph_i2Ui1_graph, | ||
viewgraph_v_corr_idxs_graph, | ||
viewgraph_two_view_reports_graph, | ||
viewgraph_estimation_metrics, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you save these metrics as a separate one, so we have numbers for stage1 and stage2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO this will be overly verbose. We already get visualizations saved for each of the two stages, currently, and I think the combined performance is what matters most. |
||
) = self.view_graph_estimator_v2.create_computation_graph( | ||
viewgraph_i2Ri1_graph, | ||
viewgraph_i2Ui1_graph, | ||
all_intrinsics, | ||
viewgraph_v_corr_idxs_graph, | ||
keypoints_list, | ||
viewgraph_two_view_reports_graph, | ||
debug_output_dir / "2", | ||
) | ||
else: | ||
viewgraph_i2Ri1_graph = dask.delayed(i2Ri1_dict) | ||
viewgraph_i2Ui1_graph = dask.delayed(i2Ui1_dict) | ||
|
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.
We should use the flag for stage 2 too?
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.
@ayushbaid did you mean to add the MEDIAN_EDGE_ERROR stage to the config also?
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.
I meant to make it optional. If we do not want to run stage 2 we can easily skip it.
But if we get good performance across the board and there is no reason to not use it, I am fine.