class_docstr: Base class for multiple object tracking.
  
  Args:
      data_preprocessor (dict or ConfigDict, optional): The pre-process
         config of :class:`TrackDataPreprocessor`.  it usually includes,
          ``pad_size_divisor``, ``pad_value``, ``mean`` and ``std``.
      init_cfg (dict or list[dict]): Initialization config dict.
class_docstr_tok: ["Base","class","for","multiple","object","tracking",".","Args",":","data_preprocessor","(","dict","or","ConfigDict",",","optional",")",":","The","pre-process","config","of",":","class",":","`","TrackDataPreprocessor","`",".","it","usually","includes",",","``","pad_size_divisor","``",",","``","pad_value","``",",","``","mean","``","and","``","std","``",".","init_cfg","(","dict","or","list","[","dict","]",")",":","Initialization","config","dict","."]
docstr: The unified entry for a forward process in both training and test.
  
  The method should accept three modes: "tensor", "predict" and "loss":
  
  - "tensor": Forward the whole network and return tensor or tuple of
  tensor without any post-processing, same as a common nn.Module.
  - "predict": Forward and return the predictions, which are fully
  processed to a list of :obj:`TrackDataSample`.
  - "loss": Forward and return a dict of losses according to the given
  inputs and data samples.
  
  Note that this method doesn't handle neither back propagation nor
  optimizer updating, which are done in the :meth:`train_step`.
  
  Args:
      inputs (Dict[str, Tensor]): of shape (N, T, C, H, W)
          encoding input images. Typically these should be mean centered
          and std scaled. The N denotes batch size. The T denotes the
          number of key/reference frames.
          - img (Tensor) : The key images.
          - ref_img (Tensor): The reference images.
      data_samples (list[:obj:`TrackDataSample`], optional): The
          annotation data of every samples. Defaults to None.
      mode (str): Return what kind of value. Defaults to 'predict'.
  
  Returns:
      The return type depends on ``mode``.
  
      - If ``mode="tensor"``, return a tensor or a tuple of tensor.
      - If ``mode="predict"``, return a list of :obj:`TrackDataSample`.
      - If ``mode="loss"``, return a dict of tensor.
docstr_tok: ["The","unified","entry","for","a","forward","process","in","both","training","and","test",".","The","method","should","accept","three","modes",":","``","tensor","''",",","``","predict","''","and","``","loss","''",":","-","``","tensor","''",":","Forward","the","whole","network","and","return","tensor","or","tuple","of","tensor","without","any","post-processing",",","same","as","a","common","nn.Module",".","-","``","predict","''",":","Forward","and","return","the","predictions",",","which","are","fully","processed","to","a","list","of",":","obj",":","`","TrackDataSample","`",".","-","``","loss","''",":","Forward","and","return","a","dict","of","losses","according","to","the","given","inputs","and","data","samples",".","Note","that","this","method","does","n't","handle","neither","back","propagation","nor","optimizer","updating",",","which","are","done","in","the",":","meth",":","`","train_step","`",".","Args",":","inputs","(","Dict","[","str",",","Tensor","]",")",":","of","shape","(","N",",","T",",","C",",","H",",","W",")","encoding","input","images",".","Typically","these","should","be","mean","centered","and","std","scaled",".","The","N","denotes","batch","size",".","The","T","denotes","the","number","of","key\/reference","frames",".","-","img","(","Tensor",")",":","The","key","images",".","-","ref_img","(","Tensor",")",":","The","reference","images",".","data_samples","(","list","[",":","obj",":","`","TrackDataSample","`","]",",","optional",")",":","The","annotation","data","of","every","samples",".","Defaults","to","None",".","mode","(","str",")",":","Return","what","kind","of","value",".","Defaults","to","'predict","'",".","Returns",":","The","return","type","depends","on","``","mode","``",".","-","If","``","mode=","''","tensor","''","``",",","return","a","tensor","or","a","tuple","of","tensor",".","-","If","``","mode=","''","predict","''","``",",","return","a","list","of",":","obj",":","`","TrackDataSample","`",".","-","If","``","mode=","''","loss","''","``",",","return","a","dict","of","tensor","."]
code: def forward(
      self,
      inputs: Dict[str, Tensor],
      data_samples: OptTrackSampleList = None,
      mode: str = "predict",
      **kwargs,
  ):
      """The unified entry for a forward process in both training and test.
  
      The method should accept three modes: "tensor", "predict" and "loss":
  
      - "tensor": Forward the whole network and return tensor or tuple of
      tensor without any post-processing, same as a common nn.Module.
      - "predict": Forward and return the predictions, which are fully
      processed to a list of :obj:`TrackDataSample`.
      - "loss": Forward and return a dict of losses according to the given
      inputs and data samples.
  
      Note that this method doesn't handle neither back propagation nor
      optimizer updating, which are done in the :meth:`train_step`.
  
      Args:
          inputs (Dict[str, Tensor]): of shape (N, T, C, H, W)
              encoding input images. Typically these should be mean centered
              and std scaled. The N denotes batch size. The T denotes the
              number of key/reference frames.
              - img (Tensor) : The key images.
              - ref_img (Tensor): The reference images.
          data_samples (list[:obj:`TrackDataSample`], optional): The
              annotation data of every samples. Defaults to None.
          mode (str): Return what kind of value. Defaults to 'predict'.
  
      Returns:
          The return type depends on ``mode``.
  
          - If ``mode="tensor"``, return a tensor or a tuple of tensor.
          - If ``mode="predict"``, return a list of :obj:`TrackDataSample`.
          - If ``mode="loss"``, return a dict of tensor.
      """
      if mode == "loss":
          return self.loss(inputs, data_samples, **kwargs)
      elif mode == "predict":
          return self.predict(inputs, data_samples, **kwargs)
      elif mode == "tensor":
          return self._forward(inputs, data_samples, **kwargs)
      else:
          raise RuntimeError(
              f'Invalid mode "{mode}". '
              "Only supports loss, predict and tensor mode"
          )
  
file_path: mmdetection/mmdet/models/mot/base.py
imports: from abc import ABCMeta, abstractmethod
  from typing import Dict, List, Tuple, Union
  from mmengine.model import BaseModel
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import OptTrackSampleList, TrackSampleList
  from mmdet.utils import OptConfigType, OptMultiConfig
label_desc: Use image node_id 8 for calling the BaseMOTModel obj's underlying member method code with example usage: obj.forward(inputs, data_samples, mode) and returns: self, self, self