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

Require min 500 tracks for batch triangulation task #729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gtsfm/data_association/data_assoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# Heuristically set to limit the number of delayed tasks, as recommended by Dask:
# https://docs.dask.org/en/stable/delayed-best-practices.html#avoid-too-many-tasks
MAX_DELAYED_TRIANGULATION_CALLS = 1e3
MIN_TRACKS_PER_BATCH = 500


@dataclass(frozen=True)
Expand Down Expand Up @@ -242,7 +243,7 @@ def triangulate_batch(
point3d_initializer = Point3dInitializer(cameras, self.triangulation_options)

# Loop through tracks and and generate delayed triangulation tasks.
batch_size = int(np.ceil(len(tracks_2d) / MAX_DELAYED_TRIANGULATION_CALLS))
batch_size = max(int(np.ceil(len(tracks_2d) / MAX_DELAYED_TRIANGULATION_CALLS)), MIN_TRACKS_PER_BATCH)
triangulation_results = []
if batch_size == 1:
for track_2d in tracks_2d:
Expand Down
Loading