File size: 844 Bytes
4d0eb62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) OpenMMLab. All rights reserved.
from mmpretrain.registry import DATASETS


def build_dataset(cfg):
    """Build dataset.

    Examples:
        >>> from mmpretrain.datasets import build_dataset
        >>> mnist_train = build_dataset(
        ...     dict(type='MNIST', data_prefix='data/mnist/', test_mode=False))
        >>> print(mnist_train)
        Dataset MNIST
            Number of samples:  60000
            Number of categories:       10
            Prefix of data:     data/mnist/
        >>> mnist_test = build_dataset(
        ...     dict(type='MNIST', data_prefix='data/mnist/', test_mode=True))
        >>> print(mnist_test)
        Dataset MNIST
            Number of samples:  10000
            Number of categories:       10
            Prefix of data:     data/mnist/
    """
    return DATASETS.build(cfg)