dgs.models.dataset.torchreid_pose_dataset.TorchreidPoseDataManager

class dgs.models.dataset.torchreid_pose_dataset.TorchreidPoseDataManager(*args: Any, **kwargs: Any)[source]

Custom torchreid DataManager for pose-based data.

Parameters:
  • root – Root path to the directory containing all the datasets.

  • sources – The types of source pose dataset(s).

  • **kwargs – Additional keyword arguments, see Other Parameters below.

  • combineall (bool) – Combine train, query and gallery in a dataset for training. Default is False.

  • targets (Type[TorchreidPoseDataset] | list[Type[TorchreidPoseDataset]]) – The types of target dataset(s). If not given, it equals to sources.

  • transforms (list[str | Callable]) – One or multiple transformations applied to model training. Default is ‘random_flip’.

  • train_sampler (str) – Name of the Sampler during training. Default “RandomSampler”.

  • use_gpu (bool) – Whether to use the gpu. Default is True.

  • batch_size_train (int) – The number of images in a training batch. Default is 32.

  • batch_size_test (int) – The number of images in a test batch. Default is 32.

  • num_instances (int) – The number of instances per identity in a batch. Default is 4.

  • num_cams (int) – The number of cameras to sample in a batch (when using RandomDomainSampler). Default is 1.

  • num_datasets (int) – The number of datasets to sample in a batch (when using RandomDatasetSampler). Default is 1.

  • train_sampler – Name of the torchreid sampler. Default is RandomSampler.

  • train_sampler_t (str) – Name of the torchreid sampler for the target train loader. Default is RandomSampler.

  • verbose (bool) – Print more debug information. Default is False.

  • workers (int) – Number of workers for the torch DataLoader. As long as no multi-GPU context is available, this value should not be changed. Default 0.

Notes

The original image-based transforms are overwritten to support key-points as input.

__init__(root: str, sources: Type[TorchreidPoseDataset] | list[Type[TorchreidPoseDataset]], **kwargs) None[source]

Methods

build_transforms([transforms])

Build transforms for pose data.

load_test()

Load the test Dataset and DataLoader as torch objects.

load_train()

Load the train Dataset and DataLoader as torch objects.

show_summary()

Show a summary describing the DataManager

Attributes

data_type

Is used within torchreid.

default_kwargs

A dict of default keyword arguments.

params

The parameters of this module.