dgs.models.dataset.posetrack21.PoseTrack21Torchreid¶
- class dgs.models.dataset.posetrack21.PoseTrack21Torchreid(*args: Any, **kwargs: Any)[source]¶
Load PoseTrack21 as torchreid dataset. Depending on the argument
instance
this Dataset either contains image crops or key point crops.Reference¶
Doering et al. Posetrack21: A dataset for person search, multi-object tracking and multi-person pose tracking. IEEE / CVF 2022.
URL¶
Dataset statistics¶
identities: The training set contains 5474 unique person ids. The biggest person id is 6878
images: 163411 images, divided into: 96215 train, 46751 test (gallery), and 20444 val (query)
- param root:
Root directory of all the datasets. Default “./data/”.
- type root:
str
- param instance:
Whether this module works as a TorchreidImageDataset or a custom TorchreidPoseDataset. Has to be one of: [“images”, “key_points”]. Default “all”.
- type instance:
str
Notes
The bbox crops are generated using either the modified
self.download_dataset()
or if you don’t want to use default configuration something similar usingextract_all_bboxes()
.Notes
Train is for training the model. The query and gallery are used for testing, where for each image in the query you find similar persons in the gallery set.
Methods
- static download_dataset(dataset_dir: str = './data/PoseTrack21', dataset_url: str | None = None, **kwargs) None [source]¶
Originally intended to download the dataset, but authentication is required.
- process_file(filepath: str, crops_dir: str, *, relabel: bool = False, cam_id: int = 0, is_kp: bool = False) list[tuple[str, int, int, int]] [source]¶
Process all the data in a single directory.
- Parameters:
filepath (FilePath) – The absolute path to the json file containing the annotations and image paths. In this case will be something like ‘…/data/PoseTrack21/posetrack_person_search/train.json’.
crops_dir (FilePath) – The absolute path to the directory containing the image crops. In this case will be something like ‘…/data/PoseTrack21/crops/train/’.
relabel (bool, optional) – Whether to create labels from to pids, to reduce the number of parameters in the model. Default False.
cam_id (int, optional) – The id of the camera to use. The cam_id of the query dataset has to be different from the cam_id of the gallery, see this issue for more details. Default 0.
is_kp (bool, optional) – Whether the files that should be loaded are key point or image files. Default False, means image files (‘.jpg’).
- Returns:
- A list of tuples containing the absolute image path,
person id (label), camera id, and dataset id. The dataset id is the video_id with a leading 1 for mpii and 2 for bonn, to remove duplicates.
- Return type:
data (list[tuple[str, int, int, int]])
- show_summary() None ¶
Print dataset summary.
Attributes
Name of the directory containing the dataset within
root
.