py123d_detection.torch.data.frames

Which frames of the resolved logs a dataset serves.

Two layers decide it. The Source thins each log while it is read, by sample_rate_hz or frame_stride, which is the right tool when the rate itself matters: 2 Hz is nuScenes’ keyframe rate, and a 10 Hz log sampled at 2 Hz is comparable to it.

FrameIndex then optionally takes a fixed number of those frames, spread evenly across all logs. That is the right tool when the amount matters: num_frames: 10000 gives ten thousand samples without first counting the split and dividing, and gives every dataset in a mix the same weight regardless of how long or how densely recorded its logs are.

Classes

FrameIndex(scenes[, num_frames, name])

The (scene, iteration) pairs behind a dataset's indices, in log order.

class py123d_detection.torch.data.frames.FrameIndex(scenes, num_frames=None, name='')[source]

Bases: object

The (scene, iteration) pairs behind a dataset’s indices, in log order.

Parameters:
  • scenes (Sequence) – The resolved logs, already thinned by their source.

  • num_frames (Optional[int]) – Keep this many frames, evenly spaced over the concatenation of all logs, so each log contributes in proportion to its length. None keeps every frame. Asking for more frames than there are keeps them all and says so.

  • name (str) – Used in log messages only.

available

Frames available before num_frames was applied.

continues_scene(index)[source]

Whether index - 1 is an earlier frame of the same log, for a temporal model.

Return type:

bool