Datasets Module

The datasets module provides dataset loading and preprocessing functionality for different video scene graph datasets.

Action Genome Dataset

class m3sgg.datasets.action_genome.AG(mode, datasize, data_path=None, filter_nonperson_box_frame=True, filter_small_box=False, print_stats=False)[source]

Bases: Dataset

__init__(mode, datasize, data_path=None, filter_nonperson_box_frame=True, filter_small_box=False, print_stats=False)[source]
valid_nums

according to the stanford method, remove the frames without person box both for training and testing filter_nonperson_box_frame = False: still use the frames without person box, FasterRCNN may find the person

Type:

filter_nonperson_box_frame = True (default)

m3sgg.datasets.action_genome.cuda_collate_fn(batch)[source]

Proper collate function that handles variable-length sequences and ensures consistent batch sizes for the model

EASG Dataset

class m3sgg.datasets.easg.EASG(split, datasize, data_path=None)[source]

Bases: Dataset

__init__(split, datasize, data_path=None)[source]
m3sgg.datasets.easg.cuda_collate_fn(batch)[source]

don’t need to zip the tensor

Dataset Factory

m3sgg.datasets.factory.get_datasets(conf: Any) Tuple[object, object][source]

Return initialized training and test dataset instances for the selected dataset.

This selects the appropriate dataset class and its constructor arguments based on conf.dataset and related configuration flags.

Parameters:

conf (Any) – The experiment configuration object containing dataset settings

Returns:

A tuple of (dataset_train, dataset_test) instances

Return type:

tuple