class_docstr: A simple Kalman filter for tracking bounding boxes in image space.
  
  The implementation is referred to https://github.com/nwojke/deep_sort.
  
  Args:
      center_only (bool): If True, distance computation is done with
          respect to the bounding box center position only.
          Defaults to False.
      use_nsa (bool): Whether to use the NSA (Noise Scale Adaptive) Kalman
          Filter, which adaptively modulates the noise scale according to
          the quality of detections. More details in
          https://arxiv.org/abs/2202.11983. Defaults to False.
class_docstr_tok: ["A","simple","Kalman","filter","for","tracking","bounding","boxes","in","image","space",".","The","implementation","is","referred","to","https",":","\/\/github.com\/nwojke\/deep_sort",".","Args",":","center_only","(","bool",")",":","If","True",",","distance","computation","is","done","with","respect","to","the","bounding","box","center","position","only",".","Defaults","to","False",".","use_nsa","(","bool",")",":","Whether","to","use","the","NSA","(","Noise","Scale","Adaptive",")","Kalman","Filter",",","which","adaptively","modulates","the","noise","scale","according","to","the","quality","of","detections",".","More","details","in","https",":","\/\/arxiv.org\/abs\/2202.11983",".","Defaults","to","False","."]
code: def __init__(self, center_only: bool = False, use_nsa: bool = False):
      if not HAS_SCIPY:
          raise RuntimeError(
              "sscikit-learn is not installed,\
                   please install it by: pip install scikit-learn"
          )
      self.center_only = center_only
      if self.center_only:
          self.gating_threshold = self.chi2inv95[2]
      else:
          self.gating_threshold = self.chi2inv95[4]
  
      self.use_nsa = use_nsa
      ndim, dt = 4, 1.0
  
      # Create Kalman filter model matrices.
      self._motion_mat = np.eye(2 * ndim, 2 * ndim)
      for i in range(ndim):
          self._motion_mat[i, ndim + i] = dt
      self._update_mat = np.eye(ndim, 2 * ndim)
  
      # Motion and observation uncertainty are chosen relative to the current
      # state estimate. These weights control the amount of uncertainty in
      # the model. This is a bit hacky.
      self._std_weight_position = 1.0 / 20
      self._std_weight_velocity = 1.0 / 160
  
file_path: mmdetection/mmdet/models/task_modules/tracking/kalman_filter.py
imports: from typing import Tuple
  import numpy
  import torch
  from mmdet.registry import TASK_UTILS
label_desc: Use image node_id 1 to create a new KalmanFilter object  with example: obj = KalmanFilter(center_only, use_nsa)