Differences with torchaudio.datasets.TEDLIUM

View Source On Gitee

torchaudio.datasets.TEDLIUM

class torchaudio.datasets.TEDLIUM(
    root: str,
    release: str = 'release1',
    subset: str = None,
    download: bool = False,
    audio_ext: str = '.sph')

For more information, see torchaudio.datasets.TEDLIUM.

mindspore.dataset.TedliumDataset

class mindspore.dataset.TedliumDataset(
    dataset_dir,
    release,
    usage=None,
    extensions=None,
    num_samples=None,
    num_parallel_workers=None,
    shuffle=None,
    sampler=None,
    num_shards=None,
    shard_id=None,
    cache=None)

For more information, see mindspore.dataset.TedliumDataset.

Differences

PyTorch: Read the Tedlium dataset.

MindSpore: Read the Tedlium dataset. Download dataset from web is not supported.

Categories

Subcategories

PyTorch

MindSpore

Difference

Parameter

Parameter1

root

dataset_dir

-

Parameter2

release

release

-

Parameter3

subset

usage

-

Parameter4

download

-

Not supported by MindSpore

Parameter5

audio_ext

extensions

-

Parameter6

-

num_samples

The number of images to be included in the dataset

Parameter7

-

num_parallel_workers

Number of worker threads to read the data

Parameter8

-

shuffle

Whether to perform shuffle on the dataset

Parameter9

-

sampler

Object used to choose samples from the dataset

Parameter10

-

num_shards

Number of shards that the dataset will be divided into

Parameter11

-

shard_id

The shard ID within num_shards

Parameter12

-

cache

Use tensor caching service to speed up dataset processing

Code Example

# PyTorch
import torchaudio.datasets as datasets
from torch.utils.data import DataLoader

root = "/path/to/dataset_directory/"
dataset = datasets.TEDLIUM(root, release='release1')
dataloader = DataLoader(dataset)

# MindSpore
import mindspore.dataset as ds

# Download Tedlium dataset files, unzip into the following structure
# .
# └──TEDLIUM_release1
#     └── dev
#         ├── sph
#             ├── AlGore_2009.sph
#             ├── BarrySchwartz_2005G.sph
#         ├── stm
#             ├── AlGore_2009.stm
#             ├── BarrySchwartz_2005G.stm
#     └── test
#         ├── sph
#             ├── AimeeMullins_2009P.sph
#             ├── BillGates_2010.sph
#         ├── stm
#             ├── AimeeMullins_2009P.stm
#             ├── BillGates_2010.stm
#     └── train
#         ├── sph
#             ├── AaronHuey_2010X.sph
#             ├── AdamGrosser_2007.sph
#         ├── stm
#             ├── AaronHuey_2010X.stm
#             ├── AdamGrosser_2007.stm
#     └── readme
#     └── TEDLIUM.150k.dic
root = "/path/to/dataset_directory/"
ms_dataloader = ds.TedliumDataset(root, release='release1')