示例#1
0
def load_dataset(config, train):
    """
    Loads a dataset.

    Parameters
    ----------
    config : DotDict
        Configuration to use.
    train : bool
        Whether to load the training or testing dataset.
    """
    name = config.dataset
    if name == 'smmnist':
        from data.mmnist import MovingMNIST
        return MovingMNIST.make_dataset(config.data_dir, config.nx, config.seq_len, config.max_speed,
                                        config.deterministic, config.ndigits, train)
    if name == 'kth':
        from data.kth import KTH
        return KTH.make_dataset(config.data_dir, config.nx, config.seq_len, train)
    if name == 'human':
        from data.human import Human
        return Human.make_dataset(config.data_dir, config.nx, config.seq_len, config.subsampling, train)
    if name == 'bair':
        from data.bair import Bair
        return Bair.make_dataset(config.data_dir, config.seq_len, train)
    raise ValueError(f'No dataset named `{name}`')
示例#2
0
文件: base.py 项目: ry85/srvp
def load_dataset(config, train):
    """
    Loads a dataset.

    Parameters
    ----------
    config : helper.DotDict
        Configuration to use.
    train : bool
        Whether to load the training or testing dataset.

    Returns
    -------
    data.base.VideoDataset
        Dataset corresponding to the input configuration.
    """
    name = config.dataset
    if name == 'smmnist':
        from data.mmnist import MovingMNIST
        return MovingMNIST.make_dataset(config.data_dir, config.nx,
                                        config.seq_len, config.max_speed,
                                        config.deterministic, config.ndigits,
                                        train)
    if name == 'kth':
        from data.kth import KTH
        return KTH.make_dataset(config.data_dir, config.nx, config.seq_len,
                                train)
    if name == 'human':
        from data.human import Human
        return Human.make_dataset(config.data_dir, config.nx, config.seq_len,
                                  config.subsampling, train)
    if name == 'bair':
        from data.bair import BAIR
        return BAIR.make_dataset(config.data_dir, config.seq_len, train)
    raise ValueError(f'No dataset named \'{name}\'')