FutureDetectionsAggregatorΒΆ
- class standard_e2e.caching.segment_context.FutureDetectionsAggregator(data_path)[source]ΒΆ
Bases:
SegmentContextAggregatorAggregate future detections into the current frameβs modality payload.
- Parameters:
data_path (str)
- 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_parallelis 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(ornum_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 andforkwould 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: