class_docstr: Mask RCNN network.
  
  Parameters
  ----------
  features : gluon.HybridBlock
      Base feature extractor before feature pooling layer.
  top_features : gluon.HybridBlock
      Tail feature extractor after feature pooling layer.
  classes : iterable of str
      Names of categories, its length is ``num_class``.
  mask_channels : int, default is 256
      Number of channels in mask prediction
  rcnn_max_dets : int, default is 1000
      Number of rois to retain in RCNN.
      Upper bounded by min of rpn_test_pre_nms and rpn_test_post_nms.
  rpn_test_pre_nms : int, default is 6000
      Filter top proposals before NMS in testing of RPN.
  rpn_test_post_nms : int, default is 1000
      Return top proposal results after NMS in testing of RPN.
      Will be set to rpn_test_pre_nms if it is larger than rpn_test_pre_nms.
  target_roi_scale : int, default 1
      Ratio of mask output roi / input roi. For model with FPN, this is typically 2.
  num_fcn_convs : int, default 0
      number of convolution blocks before deconv layer. For FPN network this is typically 4.
class_docstr_tok: ["Mask","RCNN","network",".","Parameters","--","--","--","--","--","features",":","gluon.HybridBlock","Base","feature","extractor","before","feature","pooling","layer",".","top_features",":","gluon.HybridBlock","Tail","feature","extractor","after","feature","pooling","layer",".","classes",":","iterable","of","str","Names","of","categories",",","its","length","is","``","num_class","``",".","mask_channels",":","int",",","default","is","256","Number","of","channels","in","mask","prediction","rcnn_max_dets",":","int",",","default","is","1000","Number","of","rois","to","retain","in","RCNN",".","Upper","bounded","by","min","of","rpn_test_pre_nms","and","rpn_test_post_nms",".","rpn_test_pre_nms",":","int",",","default","is","6000","Filter","top","proposals","before","NMS","in","testing","of","RPN",".","rpn_test_post_nms",":","int",",","default","is","1000","Return","top","proposal","results","after","NMS","in","testing","of","RPN",".","Will","be","set","to","rpn_test_pre_nms","if","it","is","larger","than","rpn_test_pre_nms",".","target_roi_scale",":","int",",","default","1","Ratio","of","mask","output","roi","\/","input","roi",".","For","model","with","FPN",",","this","is","typically","2.","num_fcn_convs",":","int",",","default","0","number","of","convolution","blocks","before","deconv","layer",".","For","FPN","network","this","is","typically","4","."]
docstr: Reset class categories and class predictors.
  
  Parameters
  ----------
  classes : iterable of str
      The new categories. ['apple', 'orange'] for example.
  reuse_weights : dict
      A {new_integer : old_integer} or mapping dict or {new_name : old_name} mapping dict,
      or a list of [name0, name1,...] if class names don't change.
      This allows the new predictor to reuse the
      previously trained weights specified.
  
  Example
  -------
  >>> net = gluoncv.model_zoo.get_model('mask_rcnn_resnet50_v1b_voc', pretrained=True)
  >>> # use direct name to name mapping to reuse weights
  >>> net.reset_class(classes=['person'], reuse_weights={'person':'person'})
  >>> # or use interger mapping, person is the first category in COCO
  >>> net.reset_class(classes=['person'], reuse_weights={0:0})
  >>> # you can even mix them
  >>> net.reset_class(classes=['person'], reuse_weights={'person':0})
  >>> # or use a list of string if class name don't change
  >>> net.reset_class(classes=['person'], reuse_weights=['person'])
docstr_tok: ["Reset","class","categories","and","class","predictors",".","Parameters","--","--","--","--","--","classes",":","iterable","of","str","The","new","categories",".","[","'apple","'",",","'orange","'","]","for","example",".","reuse_weights",":","dict","A","{","new_integer",":","old_integer","}","or","mapping","dict","or","{","new_name",":","old_name","}","mapping","dict",",","or","a","list","of","[","name0",",","name1",",","...","]","if","class","names","do","n't","change",".","This","allows","the","new","predictor","to","reuse","the","previously","trained","weights","specified",".","Example","--","--","--","-",">",">",">","net","=","gluoncv.model_zoo.get_model","(","'mask_rcnn_resnet50_v1b_voc","'",",","pretrained=True",")",">",">",">","#","use","direct","name","to","name","mapping","to","reuse","weights",">",">",">","net.reset_class","(","classes=","[","'person","'","]",",","reuse_weights=","{","'person","'",":","'person","'","}",")",">",">",">","#","or","use","interger","mapping",",","person","is","the","first","category","in","COCO",">",">",">","net.reset_class","(","classes=","[","'person","'","]",",","reuse_weights=","{","0:0","}",")",">",">",">","#","you","can","even","mix","them",">",">",">","net.reset_class","(","classes=","[","'person","'","]",",","reuse_weights=","{","'person':0","}",")",">",">",">","#","or","use","a","list","of","string","if","class","name","do","n't","change",">",">",">","net.reset_class","(","classes=","[","'person","'","]",",","reuse_weights=","[","'person","'","]",")"]
code: def reset_class(self, classes, reuse_weights=None):
      """Reset class categories and class predictors.
  
      Parameters
      ----------
      classes : iterable of str
          The new categories. ['apple', 'orange'] for example.
      reuse_weights : dict
          A {new_integer : old_integer} or mapping dict or {new_name : old_name} mapping dict,
          or a list of [name0, name1,...] if class names don't change.
          This allows the new predictor to reuse the
          previously trained weights specified.
  
      Example
      -------
      >>> net = gluoncv.model_zoo.get_model('mask_rcnn_resnet50_v1b_voc', pretrained=True)
      >>> # use direct name to name mapping to reuse weights
      >>> net.reset_class(classes=['person'], reuse_weights={'person':'person'})
      >>> # or use interger mapping, person is the first category in COCO
      >>> net.reset_class(classes=['person'], reuse_weights={0:0})
      >>> # you can even mix them
      >>> net.reset_class(classes=['person'], reuse_weights={'person':0})
      >>> # or use a list of string if class name don't change
      >>> net.reset_class(classes=['person'], reuse_weights=['person'])
  
      """
      self._clear_cached_op()
      super(MaskRCNN, self).reset_class(
          classes=classes, reuse_weights=reuse_weights
      )
      self.mask.reset_class(
          classes=classes, reuse_weights=reuse_weights
      )
      self.mask_target = MaskTargetGenerator(
          self._batch_size,
          self._num_sample,
          self.num_class,
          self._target_roi_size,
      )
  
imports: from __future__ import absolute_import
  import os
  import warnings
  import mxnet
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.nn import SyncBatchNorm
  from .rcnn_target import MaskTargetGenerator
  from ..faster_rcnn import FasterRCNN
  from ..rcnn import custom_rcnn_fpn
label_desc: Use image node_id 3 for calling the MaskRCNN obj's underlying member method code with example usage: obj.reset_class(classes, reuse_weights) without return types