dgs.models.dataset.posetrack21.PoseTrack21_Image¶
- class dgs.models.dataset.posetrack21.PoseTrack21_Image(*args: Any, **kwargs: Any)[source]¶
Load a single precomputed json file from the
PoseTrack21
dataset where every index represents one image. Every getitem call therefore returns aState
object, containing zero or more bounding-boxes of people detected on this image.Params¶
- id_map (FilePath, optional):
The (local or absolute) path to a json file containing a mapping from person ID to classifier ID. Both IDs are python integers, the IDs of the classifier should be continuous and zero-indexed. If the number of classes is required for other parameters, e.g., the size of a classifier, the length of this ID map should have the correct value. By default, this value is not set or None. In case this value is not present, the mapping will be created from scratch as the enumerated sorted person IDs.
- load_img_crops (bool, optional):
Whether to load the image crops during the __getitem__ call. Default
DEF_VAL["dataset"]["pt21"]["load_img_crops"]
.
Important Inherited Params¶
- dataset_path (FilePath):
Path to the directory of the dataset. The value has to either be a local project path, or a valid absolute path.
- force_img_reshape (bool, optional):
Whether to accept that images in one folder might have different shapes. Default
DEF_VAL.dataset.force_img_reshape
.
- __init__(config: dict[str, any], path: list[str]) None [source]¶
Methods
arbitrary_to_ds
(a, idx)Convert raw PoseTrack21 annotations to a
State
object.configure_torch_module
(module[, train])Set compute mode and send model to the device or multiple parallel devices if applicable.
get_image_crops
(ds)Add the image crops and local key-points to a given state.
get_path_in_dataset
(path)Given an arbitrary file- or directory-path, return its absolute path.
Terminate this module and all of its submodules.
Given one single image, with its corresponding bounding boxes and key-points, obtain a cropped image for every bounding box with localized key-points.
Given an image, bboxes, and key-points, resize them with custom modes.
validate_params
(validations[, attrib_name])Given per key validations, validate this module's parameters.
Attributes
The format of the bounding boxes.
Get the device of this module.
Get whether this module is set to training-mode.
Get the name of the module.
Get the name of the module.
Get the escaped name of the module usable in filepaths by replacing spaces and underscores.
The number of key points.
Get the (floating point) precision used in multiple parts of this module.
The format of the skeleton.
The size of the images in the dataset.
Arbitrary data, which will be converted using
self.arbitrary_to_ds()
The base path to the dataset.