experimenting.dataset package

Dataset module

Dataset package provides a toolbox for building train/val/test datasets for a number of cores and tasks

Cores provided

  • DHP19

  • NTU

Tasks provided

  • Autoencoder

  • Classification

  • Heatmap

  • 2D joint estimation

  • 3D joint estimation

Submodules

experimenting.dataset.core module

Core dataset implementation. BaseCore may be inherhit to create a new DatasetCore. DHP19 and NTU cores are provided

class experimenting.dataset.core.BaseCore(hparams_dataset)

Bases: abc.ABC

Base class for dataset cores. Each core should implement get_frame_info and load_frame_from_id for base functionalities. Labels, heatmaps, and joints loading may be implemented as well to use the relative task implementations

get_cross_subject_partition_function()

Get partition function for cross-subject evaluation method

Note

Core class must implement get_test_subjects get_frame_info must provide frame’s subject

get_cross_view_partition_function()

Get partition function for cross-view evaluation method

Note

Core class must implement get_test_view get_frame_info must provide frame’s cam

get_frame_from_id(idx)
abstract static get_frame_info(path)

Get frame attributes given the path

Parameters

path – frame path

Returns

Frame attributes as a subscriptable object

get_heatmap_from_id(idx)
get_joint_from_id(idx)
get_label_from_id(idx)
get_test_subjects()
get_test_view()
get_train_test_split(split_at=0.8)

Get train, val, and test indexes accordingly to partition function

Parameters

split_at – Split train/val according to a given percentage

Returns

Train, val, and test indexes as numpy vectors

class experimenting.dataset.core.DHP19Core(hparams_dataset)

Bases: experimenting.dataset.core.BaseCore

DHP19 dataset core class. It provides implementation to load frames, heatmaps, 2D joints, 3D joints

DEFAULT_TEST_SUBJECTS = [1, 2, 3, 4, 5]
DEFAULT_TEST_VIEW = [1, 2]
MAX_HEIGHT = 260
MAX_WIDTH = 346
MOVEMENTS_PER_SESSION = {1: 8, 2: 6, 3: 6, 4: 6, 5: 7}
N_JOINTS = 13
get_frame_from_id(idx)
static get_frame_info(filename)

Get frame attributes given the path

Parameters

path – frame path

Returns

Frame attributes as a subscriptable object

get_heatmap_from_id(idx)
get_joint_from_id(idx)
static get_label_from_filename(filepath) → int

Given the filepath, return the correspondent movement label (range [0, 32])

Parameters

filepath (str) – frame absolute filepath

Returns

Frame label

Examples

>>> DHP19Core.get_label_from_filename("S1_session_2_mov_1_frame_249_cam_2.npy")
8
get_label_from_id(idx)
static get_standard_path(subject, session, movement, frame, cam, postfix='')
get_test_subjects()
get_test_view()
static load_frame(path)
class experimenting.dataset.core.NTUCore(hparams_dataset)

Bases: experimenting.dataset.core.BaseCore

DEFAULT_TEST_SUBJECTS = [18, 19, 20]
get_frame_from_id(idx)
static get_frame_info(path)

Get frame attributes given the path

Parameters

path – frame path

Returns

Frame attributes as a subscriptable object

get_test_subjects()
static load_frame(path)

Module contents

experimenting.dataset.get_data(hparams, dataset_constructor)
experimenting.dataset.get_dataloader(dataset, batch_size, num_workers, shuffle=True)