dgs.models.dataset.posetrack21.PoseTrack21Torchreid.process_file¶
- PoseTrack21Torchreid.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]])