dgs.utils.state.collate_list_of_history

dgs.utils.state.collate_list_of_history(batch: State | list[State] | list[list[State]]) list[State][source]

Collate function used to combine the data returned in the format of a class:ImageHistoryDataset.

With N detections, a batch of data contains N lists, each with L+1 States. This functions collates the i-th State of each of the N lists into a single list of States of length L+1.

Parameters:

batch – Either a single list with L+1 States or a list containing N list, each containing L+1 States. A single State is also supported, even though, this shouldn’t really be feasible.

Returns:

A list of States. Because there can be a different number of detections, every State can still have a different number of items.