class_docstr: dataset Augmentation for SiamRPN tracking.
  
  Parameters
  ----------
  shift : int
      length of template augmentation shift
  scale : float
      template augmentation scale ratio
  blur : float
      template augmentation blur ratio
  flip : float
      template augmentation flip ratio
  color : float
      template augmentation color ratio
class_docstr_tok: ["dataset","Augmentation","for","SiamRPN","tracking",".","Parameters","--","--","--","--","--","shift",":","int","length","of","template","augmentation","shift","scale",":","float","template","augmentation","scale","ratio","blur",":","float","template","augmentation","blur","ratio","flip",":","float","template","augmentation","flip","ratio","color",":","float","template","augmentation","color","ratio"]
docstr: shift scale augmentation
  
  Parameters
  ----------
  image : np.array
      image
  bbox : list or np.array
      bbox
  crop_bbox :
      crop size image from center
  
  Return
      image ,bbox after shift and scale
docstr_tok: ["shift","scale","augmentation","Parameters","--","--","--","--","--","image",":","np.array","image","bbox",":","list","or","np.array","bbox","crop_bbox",":","crop","size","image","from","center","Return","image",",","bbox","after","shift","and","scale"]
code: def _shift_scale_aug(self, image, bbox, crop_bbox, size):
      """shift scale augmentation
  
      Parameters
      ----------
      image : np.array
          image
      bbox : list or np.array
          bbox
      crop_bbox :
          crop size image from center
  
      Return
          image ,bbox after shift and scale
      """
      im_h, im_w = image.shape[:2]
  
      # adjust crop bounding box
      crop_bbox_center = corner2center(crop_bbox)
  
      if self.scale:
          scale_x = 1.0 + SiamRPNaugmentation.random() * self.scale
          scale_y = 1.0 + SiamRPNaugmentation.random() * self.scale
          h, w = crop_bbox_center.h, crop_bbox_center.w
          scale_x = min(scale_x, float(im_w) / w)
          scale_y = min(scale_y, float(im_h) / h)
          crop_bbox_center = Center(
              crop_bbox_center.x,
              crop_bbox_center.y,
              crop_bbox_center.w * scale_x,
              crop_bbox_center.h * scale_y,
          )
  
      crop_bbox = center2corner(crop_bbox_center)
      if self.shift:
          sx = SiamRPNaugmentation.random() * self.shift
          sy = SiamRPNaugmentation.random() * self.shift
  
          x1, y1, x2, y2 = crop_bbox
  
          sx = max(-x1, min(im_w - 1 - x2, sx))
          sy = max(-y1, min(im_h - 1 - y2, sy))
  
          crop_bbox = Corner(x1 + sx, y1 + sy, x2 + sx, y2 + sy)
  
      # adjust target bounding box
      x1, y1 = crop_bbox.x1, crop_bbox.y1
      bbox = Corner(
          bbox.x1 - x1, bbox.y1 - y1, bbox.x2 - x1, bbox.y2 - y1
      )
  
      if self.scale:
          bbox = Corner(
              bbox.x1 / scale_x,
              bbox.y1 / scale_y,
              bbox.x2 / scale_x,
              bbox.y2 / scale_y,
          )
  
      image = self._crop_roi(image, crop_bbox, size)
      return image, bbox
  
file_path: gluon-cv/gluoncv/data/transforms/track.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  from gluoncv.utils.filesystem import try_import_cv2
  from gluoncv.model_zoo.siamrpn.siamrpn_tracker import corner2center, center2corner
  from gluoncv.model_zoo.siamrpn.siamrpn_tracker import Center, Corner
label_desc: Use image node_id 7 for calling the SiamRPNaugmentation obj's underlying member method code with example usage: obj._shift_scale_aug(image, bbox, crop_bbox, size) and returns: image,  bbox