vp_suite.datasets.kth

class KTHActionsDataset(split, **dataset_kwargs)

Bases: vp_suite.base.base_dataset.VPDataset

Dataset class for the dataset “KTH Action”, as mentioned in “Recognizing human actions: a local SVM approach” by Schuldt et al. (https://ieeexplore.ieee.org/document/1334462).

Each sequence depicts a human acting according to one of six scenarios (actions).

Code by Angel Villar-Corrales, modified.

Note

Some sequences might even be shorter than 30 frames; There, the last frame is repeated to reach MAX_SEQ_LEN. Going beyond 30 frames is therefore not recommended.

ACTION_SIZE: int = 0

The size of the action vector per frame (If the dataset provides no actions, this value is 0).

CLASSES = ['boxing', 'handclapping', 'handwaving', 'walking', 'running', 'jogging']

The different scenarios that constitue this dataset.

DATASET_FRAME_SHAPE: (<class 'int'>, <class 'int'>, <class 'int'>) = (64, 64, 3)

Shape of a single frame in the dataset (height, width, channels).

DEFAULT_DATA_DIR: pathlib.Path = PosixPath('/home/runner/work/vp-suite/vp-suite/vp-suite-data/data/kth_actions')

The default save location of the dataset files.

IS_DOWNLOADABLE: str = 'Yes'

A string identifying whether the dataset can be (freely) downloaded.

MIN_SEQ_LEN: int = 30

The minimum sequence length provided by the dataset.

NAME: str = 'KTH Actions'

The dataset’s name.

REFERENCE: str = 'https://doi.org/10.1109/ICPR.2004.1334462'

The reference (publication) where the original dataset is introduced.

SHORT_CLASSES = ['walking', 'running', 'jogging']

Those scenarios where the sequence length might drop below the required frame count.

__init__(split, **dataset_kwargs)

Initializes the dataset loader by determining its split and extracting and processing all dataset attributes from the parameters given in dataset_kwargs.

Parameters
  • split (str) – The dataset’s split identifier (i.e. whether it’s a training/validation/test dataset)

  • **dataset_kwargs (Any) – Optional dataset arguments for image transformation, value_range, splitting etc.

classmethod download_and_prepare_dataset()

Downloads the specific dataset, prepares it for the video prediction task (if needed) and stores it in a default location in the ‘data/’ folder. Implemented by the derived dataset classes.

first_frame_rng_seed = 1234

Seed value for the random number generator used to determine the first frame out of a bigger sequence.

get_from_idx(i)