class_docstr: Phrase Grounding Metric.
class_docstr_tok: ["Phrase","Grounding","Metric","."]
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 = data_sample["pred_instances"]
          gt = data_sample["gt_instances"]["bboxes"]
          gt_label = data_sample["phrase_ids"]
          phrases = data_sample["phrases"]
          assert len(gt) == len(gt_label)
  
          self.results.append((pred, gt, gt_label, phrases))
  
file_path: mmdetection/mmdet/evaluation/metrics/flickr30k_metric.py
imports: from collections import defaultdict
  from typing import Dict, List, Optional, Sequence
  import numpy
  from mmengine.evaluator import BaseMetric
  from mmengine.logging import MMLogger
  from mmdet.registry import METRICS
  from ..functional import bbox_overlaps
label_desc: Use image node_id 3 for calling the Flickr30kMetric obj's underlying member method code with example usage: obj.process(data_batch, data_samples) without return types