class_docstr: Base tracker model.
  
  Args:
      momentums (dict[str:float], optional): Momentums to update the buffers.
          The `str` indicates the name of the buffer while the `float`
          indicates the momentum. Defaults to None.
      num_frames_retain (int, optional). If a track is disappeared more than
          `num_frames_retain` frames, it will be deleted in the memo.
           Defaults to 10.
class_docstr_tok: ["Base","tracker","model",".","Args",":","momentums","(","dict","[","str",":","float","]",",","optional",")",":","Momentums","to","update","the","buffers",".","The","`","str","`","indicates","the","name","of","the","buffer","while","the","`","float","`","indicates","the","momentum",".","Defaults","to","None",".","num_frames_retain","(","int",",","optional",")",".","If","a","track","is","disappeared","more","than","`","num_frames_retain","`","frames",",","it","will","be","deleted","in","the","memo",".","Defaults","to","10","."]
docstr: Crop the images according to some bounding boxes. Typically for re-
  identification sub-module.
  
  Args:
      img (Tensor): of shape (T, C, H, W) encoding input image.
          Typically these should be mean centered and std scaled.
      meta_info (dict): image information dict where each dict
          has: 'img_shape', 'scale_factor', 'flip', and may also contain
          'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
      bboxes (Tensor): of shape (N, 4) or (N, 5).
      rescale (bool, optional): If True, the bounding boxes should be
          rescaled to fit the scale of the image. Defaults to False.
  
  Returns:
      Tensor: Image tensor of shape (T, C, H, W).
docstr_tok: ["Crop","the","images","according","to","some","bounding","boxes",".","Typically","for","re-","identification","sub-module",".","Args",":","img","(","Tensor",")",":","of","shape","(","T",",","C",",","H",",","W",")","encoding","input","image",".","Typically","these","should","be","mean","centered","and","std","scaled",".","meta_info","(","dict",")",":","image","information","dict","where","each","dict","has",":","'img_shape","'",",","'scale_factor","'",",","'flip","'",",","and","may","also","contain","'filename","'",",","'ori_shape","'",",","'pad_shape","'",",","and","'img_norm_cfg","'",".","bboxes","(","Tensor",")",":","of","shape","(","N",",","4",")","or","(","N",",","5",")",".","rescale","(","bool",",","optional",")",":","If","True",",","the","bounding","boxes","should","be","rescaled","to","fit","the","scale","of","the","image",".","Defaults","to","False",".","Returns",":","Tensor",":","Image","tensor","of","shape","(","T",",","C",",","H",",","W",")","."]
code: def crop_imgs(
      self,
      img: torch.Tensor,
      meta_info: dict,
      bboxes: torch.Tensor,
      rescale: bool = False,
  ) -> torch.Tensor:
      """Crop the images according to some bounding boxes. Typically for re-
      identification sub-module.
  
      Args:
          img (Tensor): of shape (T, C, H, W) encoding input image.
              Typically these should be mean centered and std scaled.
          meta_info (dict): image information dict where each dict
              has: 'img_shape', 'scale_factor', 'flip', and may also contain
              'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
          bboxes (Tensor): of shape (N, 4) or (N, 5).
          rescale (bool, optional): If True, the bounding boxes should be
              rescaled to fit the scale of the image. Defaults to False.
  
      Returns:
          Tensor: Image tensor of shape (T, C, H, W).
      """
      h, w = meta_info["img_shape"]
      img = img[:, :, :h, :w]
      if rescale:
          factor_x, factor_y = meta_info["scale_factor"]
          bboxes[:, :4] *= torch.tensor(
              [factor_x, factor_y, factor_x, factor_y]
          ).to(bboxes.device)
      bboxes[:, 0] = torch.clamp(bboxes[:, 0], min=0, max=w - 1)
      bboxes[:, 1] = torch.clamp(bboxes[:, 1], min=0, max=h - 1)
      bboxes[:, 2] = torch.clamp(bboxes[:, 2], min=1, max=w)
      bboxes[:, 3] = torch.clamp(bboxes[:, 3], min=1, max=h)
  
      crop_imgs = []
      for bbox in bboxes:
          x1, y1, x2, y2 = map(int, bbox)
          if x2 <= x1:
              x2 = x1 + 1
          if y2 <= y1:
              y2 = y1 + 1
          crop_img = img[:, :, y1:y2, x1:x2]
          if self.reid.get("img_scale", False):
              crop_img = F.interpolate(
                  crop_img,
                  size=self.reid["img_scale"],
                  mode="bilinear",
                  align_corners=False,
              )
          crop_imgs.append(crop_img)
  
      if len(crop_imgs) > 0:
          return torch.cat(crop_imgs, dim=0)
      elif self.reid.get("img_scale", False):
          _h, _w = self.reid["img_scale"]
          return img.new_zeros((0, 3, _h, _w))
      else:
          return img.new_zeros((0, 3, h, w))
  
file_path: mmdetection/mmdet/models/trackers/base_tracker.py
imports: from abc import ABCMeta, abstractmethod
  from typing import List, Optional, Tuple
  import torch
  import torch.nn.functional
  from addict import Dict
label_desc: Use image node_id 13 for calling the BaseTracker obj's underlying member method code with example usage: obj.crop_imgs(img, meta_info, bboxes, rescale) and returns: torch, img, img