class documentation

Base class for datasets that have keypoints and images.

Method __getitem__ Undocumented
Method __init__ Undocumented
Method __len__ Undocumented
Method make_dataloader Make a dataloader for the dataset.
Constant EXTRA_TOKENS Extra tokens that are present in the dataset, an OrderedDict of {name: index_in_dataset}. These will be added to the batch if they are present in the mask.
Constant MAPPING Mapping from the dataset's keypoints to the unipose format, an OrderedDict of {index_in_unipose: index_in_dataset}.
Method _apply_mapping Apply the mapping from any dataset to the unipose format. This is used to reorder the keypoints and mask to the unipose format, according to the MAPPING and EXTRA_TOKENS class variables.
@abstractmethod
def __getitem__(self):
@abstractmethod
def __init__(self):
def make_dataloader(self, image_size=256, scale_factor=4, *args, **kwargs):

Make a dataloader for the dataset.

A unipose dataset returns a dictionary with the following keys: "images", "keypoint_images", "masks", "extra_keypoints", "extra_tokens".

Parameters
image_size:intThe size of the image to resize to.
scale_factor:intThe factor to scale the image by.
*argsOther arguments to pass to the DataLoader.
**kwargsOther keyword arguments to pass to the DataLoader.
EXTRA_TOKENS =

Extra tokens that are present in the dataset, an OrderedDict of {name: index_in_dataset}. These will be added to the batch if they are present in the mask.

Value
OrderedDict()
MAPPING =

Mapping from the dataset's keypoints to the unipose format, an OrderedDict of {index_in_unipose: index_in_dataset}.

Value
OrderedDict({i: i for i in range(13)})
def _apply_mapping(self, keypoints, mask):

Apply the mapping from any dataset to the unipose format. This is used to reorder the keypoints and mask to the unipose format, according to the MAPPING and EXTRA_TOKENS class variables.

Parameters
keypoints:torch.TensorThe keypoints to reorder.
mask:torch.TensorThe mask to reorder.