class_docstr: build SiamRPNTracker.predicted tracking result.and according to
  tracking result, product window penalty and smooth bbox
  
  Parameters
  ----------
      PENALTY_K : float
          Scale penalty
      WINDOW_INFLUENCE :float
          Window influence
      LR : float
          Interpolation learning rate
      EXEMPLAR_SIZE : int
          EXEMPLAR_SIZE
      INSTANCE_SIZE : int
          INSTANCE_SIZE
      BASE_SIZE : int
          Base size
      CONTEXT_AMOUNT : float
          Context amount
      STRIDE : int
          Anchor stride
      RATIOS : tuple
          Anchor ratios
      SCALES : tuple
          Anchor scales
class_docstr_tok: ["build","SiamRPNTracker.predicted","tracking","result.and","according","to","tracking","result",",","product","window","penalty","and","smooth","bbox","Parameters","--","--","--","--","--","PENALTY_K",":","float","Scale","penalty","WINDOW_INFLUENCE",":","float","Window","influence","LR",":","float","Interpolation","learning","rate","EXEMPLAR_SIZE",":","int","EXEMPLAR_SIZE","INSTANCE_SIZE",":","int","INSTANCE_SIZE","BASE_SIZE",":","int","Base","size","CONTEXT_AMOUNT",":","float","Context","amount","STRIDE",":","int","Anchor","stride","RATIOS",":","tuple","Anchor","ratios","SCALES",":","tuple","Anchor","scales"]
docstr: Get the predicted box according to the previous definition
  and simultaneously perform the scale penalty, window penalty, and smooth bbox.
  get best score bbox
  
  Parameters
  ----------
  img : np.ndarray
      BGR image
  ctx : mxnet.Context
      Context such as mx.cpu(), mx.gpu(0).
  
  Returns
  ----------
      bbox location and score
docstr_tok: ["Get","the","predicted","box","according","to","the","previous","definition","and","simultaneously","perform","the","scale","penalty",",","window","penalty",",","and","smooth","bbox",".","get","best","score","bbox","Parameters","--","--","--","--","--","img",":","np.ndarray","BGR","image","ctx",":","mxnet.Context","Context","such","as","mx.cpu","(",")",",","mx.gpu","(","0",")",".","Returns","--","--","--","--","--","bbox","location","and","score"]
code: def track(self, img, ctx):
      """
      Get the predicted box according to the previous definition
      and simultaneously perform the scale penalty, window penalty, and smooth bbox.
      get best score bbox
  
      Parameters
      ----------
      img : np.ndarray
          BGR image
      ctx : mxnet.Context
          Context such as mx.cpu(), mx.gpu(0).
  
      Returns
      ----------
          bbox location and score
      """
      # calculate z crop size
      w_z = self.size[0] + self.CONTEXT_AMOUNT * np.sum(self.size)
      h_z = self.size[1] + self.CONTEXT_AMOUNT * np.sum(self.size)
      s_z = np.sqrt(w_z * h_z)
      scale_z = self.EXEMPLAR_SIZE / s_z
      s_x = s_z * (self.INSTANCE_SIZE / self.EXEMPLAR_SIZE)
      x_crop = self.get_subwindow(
          img,
          self.center_pos,
          self.INSTANCE_SIZE,
          round(s_x),
          self.channel_average,
          ctx,
      )
      outputs = self.model.track(x_crop)
      # get coordinate
      pred_bbox = self._convert_bbox(outputs["loc"], self.anchors)
      # get cls
      score = self._convert_score(outputs["cls"])
  
      def change(hw_r):
          return np.maximum(hw_r, 1.0 / hw_r)
  
      def get_scale(bbox_w, bbox_h):
          pad = (bbox_w + bbox_h) * 0.5
          return np.sqrt((bbox_w + pad) * (bbox_h + pad))
  
      # scale penalty，
      # compare the overall scale of the proposal and last frame
      s_c = change(
          get_scale(pred_bbox[2, :], pred_bbox[3, :])
          / (get_scale(self.size[0] * scale_z, self.size[1] * scale_z))
      )
  
      # aspect ratio penalty. ratio is ratio of height and width.
      # compare proposal’s ratio and last frame
      r_c = change(
          (self.size[0] / self.size[1])
          / (pred_bbox[2, :] / pred_bbox[3, :])
      )
      penalty = np.exp(-(r_c * s_c - 1) * self.PENALTY_K)
      pscore = penalty * score
  
      # window penalty
      pscore = (
          pscore * (1 - self.WINDOW_INFLUENCE)
          + self.window * self.WINDOW_INFLUENCE
      )
      best_idx = np.argmax(pscore)
  
      bbox = pred_bbox[:, best_idx] / scale_z
      penalty_lr = penalty[best_idx] * score[best_idx] * self.LR
  
      center_x = bbox[0] + self.center_pos[0]
      center_y = bbox[1] + self.center_pos[1]
  
      # smooth bbox
      width = self.size[0] * (1 - penalty_lr) + bbox[2] * penalty_lr
      height = self.size[1] * (1 - penalty_lr) + bbox[3] * penalty_lr
  
      # clip boundary
      center_x, center_y, width, height = self._bbox_clip(
          center_x, center_y, width, height, img.shape[:2]
      )
  
      # udpate state
      self.center_pos = np.array([center_x, center_y])
      self.size = np.array([width, height])
  
      bbox = [
          center_x - width / 2,
          center_y - height / 2,
          width,
          height,
      ]
      best_score = score[best_idx]
      return {"bbox": bbox, "best_score": best_score}
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  from collections import namedtuple
  import numpy
  import mxnet
  from mxnet import nd
  from gluoncv.utils.filesystem import try_import_cv2
label_desc: Use image node_id 8 for calling the SiamRPNTracker obj's underlying member method code with example usage: obj.track(img, ctx) and returns: dict, np, np