Skip to content

Commit

Permalink
Require min 500 tracks for batch triangulation task
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushbaid committed Oct 7, 2023
1 parent af7ce85 commit 50cbe3e
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 50cbe3e

Please sign in to comment.