class_docstr: Base class for Faster R-CNN with a ResNet backbone and FPN.
  
  A subclass of this class should have :obj:`_base` and :obj:`_models`.
  
  Args:
      n_fg_class (int): The number of classes excluding the background.
      pretrained_model (string): The weight file to be loaded.
          This can take :obj:`'coco'`, `filepath` or :obj:`None`.
          The default value is :obj:`None`.
  
          * :obj:`'coco'`: Load weights trained on train split of                 MS COCO 2017.                 The weight file is downloaded and cached automatically.                 :obj:`n_fg_class` must be :obj:`80` or :obj:`None`.
          * :obj:`'imagenet'`: Load weights of ResNet-50 trained on                 ImageNet.                 The weight file is downloaded and cached automatically.                 This option initializes weights partially and the rests are                 initialized randomly. In this case, :obj:`n_fg_class`                 can be set to any number.
          * `filepath`: A path of npz file. In this case, :obj:`n_fg_class`                 must be specified properly.
          * :obj:`None`: Do not load weights.
      return_values (list of strings): Determines the values
          returned by :meth:`predict`.
      min_size (int): A preprocessing paramter for :meth:`prepare`. Please             refer to :meth:`prepare`.
      max_size (int): A preprocessing paramter for :meth:`prepare`.
class_docstr_tok: ["Base","class","for","Faster","R-CNN","with","a","ResNet","backbone","and","FPN",".","A","subclass","of","this","class","should","have",":","obj",":","`","_base","`","and",":","obj",":","`","_models","`",".","Args",":","n_fg_class","(","int",")",":","The","number","of","classes","excluding","the","background",".","pretrained_model","(","string",")",":","The","weight","file","to","be","loaded",".","This","can","take",":","obj",":","`","'coco","'","`",",","`","filepath","`","or",":","obj",":","`","None","`",".","The","default","value","is",":","obj",":","`","None","`",".","*",":","obj",":","`","'coco","'","`",":","Load","weights","trained","on","train","split","of","MS","COCO","2017",".","The","weight","file","is","downloaded","and","cached","automatically",".",":","obj",":","`","n_fg_class","`","must","be",":","obj",":","`","80","`","or",":","obj",":","`","None","`",".","*",":","obj",":","`","'imagenet","'","`",":","Load","weights","of","ResNet-50","trained","on","ImageNet",".","The","weight","file","is","downloaded","and","cached","automatically",".","This","option","initializes","weights","partially","and","the","rests","are","initialized","randomly",".","In","this","case",",",":","obj",":","`","n_fg_class","`","can","be","set","to","any","number",".","*","`","filepath","`",":","A","path","of","npz","file",".","In","this","case",",",":","obj",":","`","n_fg_class","`","must","be","specified","properly",".","*",":","obj",":","`","None","`",":","Do","not","load","weights",".","return_values","(","list","of","strings",")",":","Determines","the","values","returned","by",":","meth",":","`","predict","`",".","min_size","(","int",")",":","A","preprocessing","paramter","for",":","meth",":","`","prepare","`",".","Please","refer","to",":","meth",":","`","prepare","`",".","max_size","(","int",")",":","A","preprocessing","paramter","for",":","meth",":","`","prepare","`","."]
code: def __init__(
      self,
      n_fg_class=None,
      pretrained_model=None,
      return_values=["bboxes", "labels", "scores"],
      min_size=800,
      max_size=1333,
  ):
      param, path = utils.prepare_pretrained_model(
          {"n_fg_class": n_fg_class}, pretrained_model, self._models
      )
  
      base = self._base(n_class=1, arch="he")
      base.pick = ("res2", "res3", "res4", "res5")
      base.pool1 = lambda x: F.max_pooling_2d(
          x, 3, stride=2, pad=1, cover_all=False
      )
      base.remove_unused()
      extractor = FPN(
          base, len(base.pick), (1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64)
      )
  
      super(FasterRCNNFPNResNet, self).__init__(
          extractor=extractor,
          rpn=RPN(extractor.scales),
          bbox_head=BboxHead(param["n_fg_class"] + 1, extractor.scales),
          mask_head=MaskHead(param["n_fg_class"] + 1, extractor.scales),
          return_values=return_values,
          min_size=min_size,
          max_size=max_size,
      )
  
      if path == "imagenet":
          _copyparams(
              self.extractor.base,
              self._base(pretrained_model="imagenet", arch="he"),
          )
      elif path:
          chainer.serializers.load_npz(path, self)
  
imports: from __future__ import division
  import chainer
  import chainer.functions
  import chainer.links
  from chainercv.links.model.fpn.bbox_head import BboxHead
  from chainercv.links.model.fpn.faster_rcnn import FasterRCNN
  from chainercv.links.model.fpn.fpn import FPN
  from chainercv.links.model.fpn.mask_head import MaskHead
  from chainercv.links.model.fpn.rpn import RPN
  from chainercv.links.model.resnet import ResNet101
  from chainercv.links.model.resnet import ResNet50
  from chainercv import utils
label_desc: Use image node_id 1 to create a new FasterRCNNFPNResNet object from inherited base classes: FasterRCNN with example: obj = FasterRCNNFPNResNet(n_fg_class, pretrained_model, return_values, min_size, max_size)