class BaseJointDataset(Dataset, ABC):
Known subclasses: unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDataset
Base class for datasets that have keypoints and images.
| Method | __getitem__ |
Undocumented |
| Method | __init__ |
Undocumented |
| Method | __len__ |
Undocumented |
| Method | make |
Make a dataloader for the dataset. |
| Constant | EXTRA |
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 |
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. |
unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetUndocumented
unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetUndocumented
unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetUndocumented
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 | |
imageint | The size of the image to resize to. |
scaleint | The factor to scale the image by. |
| *args | Other arguments to pass to the DataLoader. |
| **kwargs | Other keyword arguments to pass to the DataLoader. |
unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetExtra 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 |
|
unipose.datasets.AnimalKingdomDataset, unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetMapping from the dataset's keypoints to the unipose format, an OrderedDict of {index_in_unipose: index_in_dataset}.
| Value |
|
unipose.datasets.COCODataset, unipose.datasets.MPIIDatasetApply 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.Tensor | The keypoints to reorder. |
mask:torch.Tensor | The mask to reorder. |