class_docstr: Default Mask RCNN training transform.
  
  Parameters
  ----------
  short : int/tuple, default is 600
      Resize image shorter side to ``short``.
      Resize the shorter side of the image randomly within the given range, if it is a tuple.
  max_size : int, default is 1000
      Make sure image longer side is smaller than ``max_size``.
  net : mxnet.gluon.HybridBlock, optional
      The Mask R-CNN network.
  
      .. hint::
  
          If net is ``None``, the transformation will not generate training targets.
          Otherwise it will generate training targets to accelerate the training phase
          since we push some workload to CPU workers instead of GPUs.
  
  mean : array-like of size 3
      Mean pixel values to be subtracted from image tensor. Default is [0.485, 0.456, 0.406].
  std : array-like of size 3
      Standard deviation to be divided from image. Default is [0.229, 0.224, 0.225].
  box_norm : array-like of size 4, default is (1., 1., 1., 1.)
      Std value to be divided from encoded values.
  num_sample : int, default is 256
      Number of samples for RPN targets.
  pos_iou_thresh : float, default is 0.7
      Anchors larger than ``pos_iou_thresh`` is regarded as positive samples.
  neg_iou_thresh : float, default is 0.3
      Anchors smaller than ``neg_iou_thresh`` is regarded as negative samples.
      Anchors with IOU in between ``pos_iou_thresh`` and ``neg_iou_thresh`` are
      ignored.
  pos_ratio : float, default is 0.5
      ``pos_ratio`` defines how many positive samples (``pos_ratio * num_sample``) is
      to be sampled.
  ashape : int, default is 128
      Defines shape of pre generated anchors for target generation
  multi_stage : boolean, default is False
      Whether the network output multi stage features.
class_docstr_tok: ["Default","Mask","RCNN","training","transform",".","Parameters","--","--","--","--","--","short",":","int\/tuple",",","default","is","600","Resize","image","shorter","side","to","``","short","``",".","Resize","the","shorter","side","of","the","image","randomly","within","the","given","range",",","if","it","is","a","tuple",".","max_size",":","int",",","default","is","1000","Make","sure","image","longer","side","is","smaller","than","``","max_size","``",".","net",":","mxnet.gluon.HybridBlock",",","optional","The","Mask","R-CNN","network",".","..","hint",":",":","If","net","is","``","None","``",",","the","transformation","will","not","generate","training","targets",".","Otherwise","it","will","generate","training","targets","to","accelerate","the","training","phase","since","we","push","some","workload","to","CPU","workers","instead","of","GPUs",".","mean",":","array-like","of","size","3","Mean","pixel","values","to","be","subtracted","from","image","tensor",".","Default","is","[","0.485",",","0.456",",","0.406","]",".","std",":","array-like","of","size","3","Standard","deviation","to","be","divided","from","image",".","Default","is","[","0.229",",","0.224",",","0.225","]",".","box_norm",":","array-like","of","size","4",",","default","is","(","1.",",","1.",",","1.",",","1",".",")","Std","value","to","be","divided","from","encoded","values",".","num_sample",":","int",",","default","is","256","Number","of","samples","for","RPN","targets",".","pos_iou_thresh",":","float",",","default","is","0.7","Anchors","larger","than","``","pos_iou_thresh","``","is","regarded","as","positive","samples",".","neg_iou_thresh",":","float",",","default","is","0.3","Anchors","smaller","than","``","neg_iou_thresh","``","is","regarded","as","negative","samples",".","Anchors","with","IOU","in","between","``","pos_iou_thresh","``","and","``","neg_iou_thresh","``","are","ignored",".","pos_ratio",":","float",",","default","is","0.5","``","pos_ratio","``","defines","how","many","positive","samples","(","``","pos_ratio","*","num_sample","``",")","is","to","be","sampled",".","ashape",":","int",",","default","is","128","Defines","shape","of","pre","generated","anchors","for","target","generation","multi_stage",":","boolean",",","default","is","False","Whether","the","network","output","multi","stage","features","."]
code: def __init__(
      self,
      short=600,
      max_size=1000,
      net=None,
      mean=(0.485, 0.456, 0.406),
      std=(0.229, 0.224, 0.225),
      box_norm=(1.0, 1.0, 1.0, 1.0),
      num_sample=256,
      pos_iou_thresh=0.7,
      neg_iou_thresh=0.3,
      pos_ratio=0.5,
      ashape=128,
      multi_stage=False,
      **kwargs,
  ):
      self._short = short
      self._max_size = max_size
      self._mean = mean
      self._std = std
      self._box_norm = box_norm
      self._anchors = None
      self._multi_stage = multi_stage
      self._random_resize = isinstance(self._short, (tuple, list))
      self._num_sample = num_sample
      self._pos_iou_thresh = pos_iou_thresh
      self._neg_iou_thresh = neg_iou_thresh
      self._pos_ratio = pos_ratio
      self._internal_target_generator = None
      self._net_none = False
      self._kwargs = kwargs
      if net is None:
          self._net_none = True
          return
  
      # use fake data to generate fixed anchors for target generation
      anchors = []  # [P2, P3, P4, P5]
      # in case network has reset_ctx to gpu
      anchor_generator = copy.deepcopy(net.rpn.anchor_generator)
      anchor_generator.collect_params().reset_ctx(None)
      if self._multi_stage:
          for ag in anchor_generator:
              anchor = ag(mx.nd.zeros((1, 3, ashape, ashape))).reshape(
                  (1, 1, ashape, ashape, -1)
              )
              ashape = max(ashape // 2, 16)
              anchors.append(anchor)
      else:
          anchors = anchor_generator(
              mx.nd.zeros((1, 3, ashape, ashape))
          ).reshape((1, 1, ashape, ashape, -1))
      self._anchors = anchors
      # record feature extractor for infer_shape
      if not hasattr(net, "features"):
          raise ValueError(
              "Cannot find features in network, it is a Mask RCNN network?"
          )
      self._feat_sym = net.features(mx.sym.var(name="data"))
  
imports: from __future__ import absolute_import
  import copy
  from random import randint
  import mxnet
  from ..None import bbox
  from ..None import image
  from ..None import mask
label_desc: Use image node_id 1 to create a new MaskRCNNDefaultTrainTransform object from inherited base classes: object with example: obj = MaskRCNNDefaultTrainTransform(short, max_size, net, mean, std, box_norm, num_sample, pos_iou_thresh, neg_iou_thresh, pos_ratio, ashape, multi_stage)