class_docstr: Dataset for ReID.
  
  Args:
      triplet_sampler (dict, optional): The sampler for hard mining
          triplet loss. Defaults to None.
      keys: num_ids (int): The number of person ids.
            ins_per_id (int): The number of image for each person.
class_docstr_tok: ["Dataset","for","ReID",".","Args",":","triplet_sampler","(","dict",",","optional",")",":","The","sampler","for","hard","mining","triplet","loss",".","Defaults","to","None",".","keys",":","num_ids","(","int",")",":","The","number","of","person","ids",".","ins_per_id","(","int",")",":","The","number","of","image","for","each","person","."]
docstr: Get data processed by ''self.pipeline''.
  
  Args:
      idx (int): The index of ''data_info''
  
  Returns:
      Any: Depends on ''self.pipeline''
docstr_tok: ["Get","data","processed","by","``","self.pipeline","''",".","Args",":","idx","(","int",")",":","The","index","of","``","data_info","''","Returns",":","Any",":","Depends","on","``","self.pipeline","''"]
code: def prepare_data(self, idx: int) -> Any:
      """Get data processed by ''self.pipeline''.
  
      Args:
          idx (int): The index of ''data_info''
  
      Returns:
          Any: Depends on ''self.pipeline''
      """
      data_info = self.get_data_info(idx)
      if self.triplet_sampler is not None:
          img_info = self.triplet_sampling(
              data_info["gt_label"], **self.triplet_sampler
          )
          data_info = copy.deepcopy(img_info)  # triplet -> list
      else:
          data_info = copy.deepcopy(data_info)  # no triplet -> dict
      return self.pipeline(data_info)
  
file_path: mmdetection/mmdet/datasets/reid_dataset.py
imports: import copy
  import os.path
  from collections import defaultdict
  from typing import Any, Dict, List
  import numpy
  from mmengine.dataset import BaseDataset
  from mmengine.utils import check_file_exist
  from mmdet.registry import DATASETS
label_desc: Use image node_id 4 for calling the ReIDDataset obj's underlying member method code with example usage: obj.prepare_data(idx) and returns: self