Dataset#
from kagu.datasets.kagu_dataset import KaguDatasetArguments, KaguDataset
kagu_args = KaguDatasetArguments(dataset='data/kagu',
frame_size=[299,299],
world_size=4,
global_rank=0,
snippet=16,
step=8)
kagu_dataset = kagu_dataset(kagu_args)
- class kagu.datasets.kagu_dataset.KaguDatasetArguments(dataset: str, frame_size: list, world_size: int, global_rank: int, snippet: int, step: int)[source]#
Arguments for Kagu dataset
- dataset: str#
The path to the datset
- frame_size: list#
The frame size of the images
- world_size: int#
The number of proceses spawned
- global_rank: int#
The rank of the current process
- snippet: int#
Number of frames to process
- step: int#
The stride by which we process the frames. Same as snippet if not overlapping
- class kagu.datasets.kagu_dataset.KaguDataset(args: KaguDatasetArguments)[source]#
The kagu dataset class that streams video files and outputs a list of frames according to snippet and step.
- Parameters:
args (KaguDatasetArguments) – The parameters used for the Kagu dataset
- __getitem__(index)[source]#
Iterates over the dataset in a streaming fashion and retrieves
KaguDatasetArguments.snippet
frames at a time.- Parameters:
index (int) – The index of the item in the dataset to retrieve. Not used.
- Returns:
(torch.tensor): the frames in tensor format