class_docstr: Base class for a metric in video task.
  
  The metric first processes each batch of data_samples and predictions,
  and appends the processed results to the results list. Then it
  collects all results together from all ranks if distributed training
  is used. Finally, it computes the metrics of the entire dataset.
  
  A subclass of class:`BaseVideoMetric` should assign a meaningful value
  to the class attribute `default_prefix`. See the argument `prefix` for
  details.
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 track_data_sample in data_samples:
          video_data_samples = track_data_sample["video_data_samples"]
          ori_video_len = video_data_samples[0].ori_video_length
          if ori_video_len == len(video_data_samples):
              # video process
              self.process_video(video_data_samples)
          else:
              # image process
              self.process_image(video_data_samples, ori_video_len)
  
file_path: mmdetection/mmdet/evaluation/metrics/base_video_metric.py
imports: import os.path
  import pickle
  import shutil
  import tempfile
  import warnings
  from typing import Optional, Sequence
  import torch
  from mmengine.dist import barrier, broadcast, broadcast_object_list, get_dist_info, is_main_process
  from mmengine.evaluator import BaseMetric
  from mmengine.utils import mkdir_or_exist
label_desc: Use image node_id 1 for calling the BaseVideoMetric obj's underlying member method code with example usage: obj.process(data_batch, data_samples) without return types