class_docstr: Base class for FCIS.
  
  This is a base class for FCIS links supporting instance segmentation
  API [#]_. The following three stages constitute FCIS.
  
  1. **Feature extraction**: Images are taken and their         feature maps are calculated.
  2. **Region Proposal Networks**: Given the feature maps calculated in         the previous stage, produce set of RoIs around objects.
  3. **Localization, Segmentation and Classification Heads**: Using feature         maps that belong to the proposed RoIs, segment regions of the         objects, classify the categories of the objects in the RoIs and         improve localizations.
  
  Each stage is carried out by one of the callable
  :class:`chainer.Chain` objects :obj:`feature`, :obj:`rpn` and :obj:`head`.
  There are two functions :meth:`predict` and :meth:`forward` to conduct
  instance segmentation.
  :meth:`predict` takes images and returns masks, object labels
  and their scores.
  :meth:`forward` is provided for a scnerario when intermediate outputs
  are needed, for instance, for training and debugging.
  
  Links that support instance segmentation API have method :meth:`predict`
  with the same interface. Please refer to :meth:`predict` for further
  details.
  
  .. [#] Yi Li, Haozhi Qi, Jifeng Dai, Xiangyang Ji, Yichen Wei.     Fully Convolutional Instance-aware Semantic Segmentation. CVPR 2017.
  
  Args:
      extractor (callable Chain): A callable that takes a BCHW image
          array and returns feature maps.
      rpn (callable Chain): A callable that has the same interface as
          :class:`~chainercv.links.model.faster_rcnn.RegionProposalNetwork`.
          Please refer to the documentation found there.
      head (callable Chain): A callable that takes a BCHW array,
          RoIs and batch indices for RoIs.
          This returns class-agnostic segmentation scores, class-agnostic
          localization parameters, class scores, improved RoIs and batch
          indices for RoIs.
      mean (numpy.ndarray): A value to be subtracted from an image
          in :meth:`prepare`.
      min_size (int): A preprocessing parameter for :meth:`prepare`. Please
          refer to a docstring found for :meth:`prepare`.
      max_size (int): A preprocessing parameter for :meth:`prepare`.
      loc_normalize_mean (tuple of four floats): Mean values of
          localization estimates.
      loc_normalize_std (tupler of four floats): Standard deviation
          of localization estimates.
class_docstr_tok: ["Base","class","for","FCIS",".","This","is","a","base","class","for","FCIS","links","supporting","instance","segmentation","API","[","#","]","_",".","The","following","three","stages","constitute","FCIS",".","1",".","*","*","Feature","extraction","*","*",":","Images","are","taken","and","their","feature","maps","are","calculated",".","2",".","*","*","Region","Proposal","Networks","*","*",":","Given","the","feature","maps","calculated","in","the","previous","stage",",","produce","set","of","RoIs","around","objects",".","3",".","*","*","Localization",",","Segmentation","and","Classification","Heads","*","*",":","Using","feature","maps","that","belong","to","the","proposed","RoIs",",","segment","regions","of","the","objects",",","classify","the","categories","of","the","objects","in","the","RoIs","and","improve","localizations",".","Each","stage","is","carried","out","by","one","of","the","callable",":","class",":","`","chainer.Chain","`","objects",":","obj",":","`","feature","`",",",":","obj",":","`","rpn","`","and",":","obj",":","`","head","`",".","There","are","two","functions",":","meth",":","`","predict","`","and",":","meth",":","`","forward","`","to","conduct","instance","segmentation",".",":","meth",":","`","predict","`","takes","images","and","returns","masks",",","object","labels","and","their","scores",".",":","meth",":","`","forward","`","is","provided","for","a","scnerario","when","intermediate","outputs","are","needed",",","for","instance",",","for","training","and","debugging",".","Links","that","support","instance","segmentation","API","have","method",":","meth",":","`","predict","`","with","the","same","interface",".","Please","refer","to",":","meth",":","`","predict","`","for","further","details",".","..","[","#","]","Yi","Li",",","Haozhi","Qi",",","Jifeng","Dai",",","Xiangyang","Ji",",","Yichen","Wei",".","Fully","Convolutional","Instance-aware","Semantic","Segmentation",".","CVPR","2017",".","Args",":","extractor","(","callable","Chain",")",":","A","callable","that","takes","a","BCHW","image","array","and","returns","feature","maps",".","rpn","(","callable","Chain",")",":","A","callable","that","has","the","same","interface","as",":","class",":","`","~chainercv.links.model.faster_rcnn.RegionProposalNetwork","`",".","Please","refer","to","the","documentation","found","there",".","head","(","callable","Chain",")",":","A","callable","that","takes","a","BCHW","array",",","RoIs","and","batch","indices","for","RoIs",".","This","returns","class-agnostic","segmentation","scores",",","class-agnostic","localization","parameters",",","class","scores",",","improved","RoIs","and","batch","indices","for","RoIs",".","mean","(","numpy.ndarray",")",":","A","value","to","be","subtracted","from","an","image","in",":","meth",":","`","prepare","`",".","min_size","(","int",")",":","A","preprocessing","parameter","for",":","meth",":","`","prepare","`",".","Please","refer","to","a","docstring","found","for",":","meth",":","`","prepare","`",".","max_size","(","int",")",":","A","preprocessing","parameter","for",":","meth",":","`","prepare","`",".","loc_normalize_mean","(","tuple","of","four","floats",")",":","Mean","values","of","localization","estimates",".","loc_normalize_std","(","tupler","of","four","floats",")",":","Standard","deviation","of","localization","estimates","."]
docstr: Use the given preset during prediction.
  
  This method changes values of :obj:`self.nms_thresh`,
  :obj:`self.score_thresh`, :obj:`self.mask_merge_thresh`,
  :obj:`self.binary_thresh`, :obj:`self.binary_thresh` and
  :obj:`self.min_drop_size`. These values are a threshold value
  used for non maximum suppression, a threshold value
  to discard low confidence proposals in :meth:`predict`,
  a threshold value to merge mask in :meth:`predict`,
  a threshold value to binalize segmentation scores in :meth:`predict`,
  a limit number of predicted masks in one image and
  a threshold value to discard small bounding boxes respectively.
  
  If the attributes need to be changed to something
  other than the values provided in the presets, please modify
  them by directly accessing the public attributes.
  
  Args:
      preset ({'visualize', 'evaluate'): A string to determine the
          preset to use.
docstr_tok: ["Use","the","given","preset","during","prediction",".","This","method","changes","values","of",":","obj",":","`","self.nms_thresh","`",",",":","obj",":","`","self.score_thresh","`",",",":","obj",":","`","self.mask_merge_thresh","`",",",":","obj",":","`","self.binary_thresh","`",",",":","obj",":","`","self.binary_thresh","`","and",":","obj",":","`","self.min_drop_size","`",".","These","values","are","a","threshold","value","used","for","non","maximum","suppression",",","a","threshold","value","to","discard","low","confidence","proposals","in",":","meth",":","`","predict","`",",","a","threshold","value","to","merge","mask","in",":","meth",":","`","predict","`",",","a","threshold","value","to","binalize","segmentation","scores","in",":","meth",":","`","predict","`",",","a","limit","number","of","predicted","masks","in","one","image","and","a","threshold","value","to","discard","small","bounding","boxes","respectively",".","If","the","attributes","need","to","be","changed","to","something","other","than","the","values","provided","in","the","presets",",","please","modify","them","by","directly","accessing","the","public","attributes",".","Args",":","preset","(","{","'visualize","'",",","'evaluate","'",")",":","A","string","to","determine","the","preset","to","use","."]
code: def use_preset(self, preset):
      """Use the given preset during prediction.
  
      This method changes values of :obj:`self.nms_thresh`,
      :obj:`self.score_thresh`, :obj:`self.mask_merge_thresh`,
      :obj:`self.binary_thresh`, :obj:`self.binary_thresh` and
      :obj:`self.min_drop_size`. These values are a threshold value
      used for non maximum suppression, a threshold value
      to discard low confidence proposals in :meth:`predict`,
      a threshold value to merge mask in :meth:`predict`,
      a threshold value to binalize segmentation scores in :meth:`predict`,
      a limit number of predicted masks in one image and
      a threshold value to discard small bounding boxes respectively.
  
      If the attributes need to be changed to something
      other than the values provided in the presets, please modify
      them by directly accessing the public attributes.
  
      Args:
          preset ({'visualize', 'evaluate'): A string to determine the
              preset to use.
  
      """
      if preset == "visualize":
          self.nms_thresh = 0.3
          self.score_thresh = 0.7
          self.mask_merge_thresh = 0.5
          self.binary_thresh = 0.4
          self.limit = 100
          self.min_drop_size = 16
      elif preset == "evaluate":
          self.nms_thresh = 0.3
          self.score_thresh = 1e-3
          self.mask_merge_thresh = 0.5
          self.binary_thresh = 0.4
          self.limit = 100
          self.min_drop_size = 16
      elif preset == "coco_evaluate":
          self.nms_thresh = 0.3
          self.score_thresh = 1e-3
          self.mask_merge_thresh = 0.5
          self.binary_thresh = 0.4
          self.limit = 100
          self.min_drop_size = 2
      else:
          raise ValueError("preset must be visualize or evaluate")
  
file_path: chainercv/chainercv/experimental/links/model/fcis/fcis.py
imports: from __future__ import division
  import chainer
  import chainer.functions
  import numpy
  from chainercv.experimental.links.model.fcis.utils.mask_voting import mask_voting
  from chainercv.transforms.image.resize import resize
label_desc: Use image node_id 5 for calling the FCIS obj's underlying member method code with example usage: obj.use_preset(preset) without return types