FuturePastStatesFromMatricesAggregatorΒΆ

class standard_e2e.caching.segment_context.FuturePastStatesFromMatricesAggregator(data_path, max_history_length=None, max_future_length=None, max_history_delta_t=None, max_future_delta_t=None)[source]ΒΆ

Bases: SegmentContextAggregator

Derive past/future ego-relative trajectories from pose matrices.

Parameters:
  • data_path (str)

  • max_history_length (int | None)

  • max_future_length (int | None)

  • max_history_delta_t (int | None)

  • max_future_delta_t (int | None)

process(index_df, num_workers=0, do_parallel=True, start_method='spawn')ΒΆ

Run the aggregator for each segment described in index_df.

Each segment is independent β€” disjoint npz files and no shared aggregator state β€” so the per-segment loop fans out across a process pool when do_parallel is enabled.

Parameters:
  • index_df (DataFrame) – full per-frame index DataFrame.

  • num_workers (int) – 0 β†’ multiprocessing.cpu_count(). Pool size is capped at the number of segments so we never spawn idle workers.

  • do_parallel (bool) – master toggle; False (or num_workers <= 1, or a single segment) forces a sequential loop.

  • start_method (str) – "spawn" matches the frame-stage rationale β€” the parent process imports TensorFlow / OpenCV at module load and fork would duplicate that state into workers. Use "fork" only when callers can guarantee no global TF/cv2 state in the parent (e.g. unit tests).

Return type:

None