cosense3d.dataset package

Subpackages

Submodules

cosense3d.dataset.const module

cosense3d.dataset.cosense_dataset module

class cosense3d.dataset.cosense_dataset.CosenseDataset(cfgs, mode)[source]

Bases: Dataset

LABEL_COLORS = {}
VALID_CLS = []
static collate_batch(batch_list)[source]
get_valid_agents(sample_info: dict, prev_agents: List | None = None) List[source]
Return prev_agents if given else select the given number of agents in the communication range

which includes the ego agent.

Parameters

sample_info: meta info the one sample. prev_agents: list of the agent ids loader last time.

Returns

agents_ids: list of valid agent for the current sample

init_dataset()[source]

Load all necessary meta information

load_frame_data(item: int, prev_agents: List | None = None, prev_item: int | None = None, omit_gt: bool | None = False, loc_err: list | None = None) dict[source]

Load all data and annotations from one frame to standard CoSense format.

Parameters:
  • item – sample index.

  • prev_agents – only load data the previous agents if given, this is used for temporal data loading.

  • prev_item – the index of the previous loaded sample.

  • omit_gt – whether to omit loading the ground truth annotations.

  • loc_err – localization error.

Returns:

data_dict

load_meta()[source]

Load meta data from CoSense json files

load_sample_info(item: int, prev_agents: List | None = None, prev_item: int | None = None) dict[source]

Load meta info of the `item`’th sample.

Parameters:
  • item – sample index.

  • prev_agents – only load data the previous agents if given, this is used for temporal data loading.

  • prev_item – the index of the previous loaded sample.

Returns:

batch_dict: dict(scenario: str, frame: str, sample_info: dict)

parse_samples()[source]

List all frame-wise instances

cosense3d.dataset.temporal_cosense_dataset module

class cosense3d.dataset.temporal_cosense_dataset.TemporalCosenseDataset(cfgs, mode)[source]

Bases: CosenseDataset

Sequential Cosense data loader.

Module contents

cosense3d.dataset.get_dataloader(cfgs, mode='train', distributed=False)[source]