class_docstr: mAP and CMC evaluation metrics for the ReID task.
  
  Args:
      metric (str | list[str]): Metrics to be evaluated.
          Default value is `mAP`.
      metric_options: (dict, optional): Options for calculating metrics.
          Allowed keys are 'rank_list' and 'max_rank'. Defaults to None.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonymous metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Default: None
docstr: Process one batch of data samples and predictions.
  
  The processed results should be stored in ``self.results``, which will
  be used to compute the metrics when all batches have been processed.
  
  Args:
      data_batch (dict): A batch of data from the dataloader.
      data_samples (Sequence[dict]): A batch of data samples that
          contain annotations and predictions.
docstr_tok: ["Process","one","batch","of","data","samples","and","predictions",".","The","processed","results","should","be","stored","in","``","self.results","``",",","which","will","be","used","to","compute","the","metrics","when","all","batches","have","been","processed",".","Args",":","data_batch","(","dict",")",":","A","batch","of","data","from","the","dataloader",".","data_samples","(","Sequence","[","dict","]",")",":","A","batch","of","data","samples","that","contain","annotations","and","predictions","."]
code: def process(
      self, data_batch: dict, data_samples: Sequence[dict]
  ) -> None:
      """Process one batch of data samples and predictions.
  
      The processed results should be stored in ``self.results``, which will
      be used to compute the metrics when all batches have been processed.
  
      Args:
          data_batch (dict): A batch of data from the dataloader.
          data_samples (Sequence[dict]): A batch of data samples that
              contain annotations and predictions.
      """
      for data_sample in data_samples:
          pred_feature = data_sample["pred_feature"]
          assert isinstance(pred_feature, torch.Tensor)
          gt_label = data_sample.get(
              "gt_label", data_sample["gt_label"]
          )
          assert isinstance(gt_label["label"], torch.Tensor)
          result = dict(
              pred_feature=pred_feature.data.cpu(),
              gt_label=gt_label["label"].cpu(),
          )
          self.results.append(result)
  
file_path: mmdetection/mmdet/evaluation/metrics/reid_metric.py
imports: from typing import Optional, Sequence, Union
  import numpy
  import torch
  from mmengine.evaluator import BaseMetric
  from mmdet.registry import METRICS
label_desc: Use image node_id 2 for calling the ReIDMetrics obj's underlying member method code with example usage: obj.process(data_batch, data_samples) without return types