class_docstr: Single-shot Object Detection Network: https://arxiv.org/abs/1512.02325.
  
  Parameters
  ----------
  network : string or None
      Name of the base network, if `None` is used, will instantiate the
      base network from `features` directly instead of composing.
  base_size : int
      Base input size, it is speficied so SSD can support dynamic input shapes.
  features : list of str or mxnet.gluon.HybridBlock
      Intermediate features to be extracted or a network with multi-output.
      If `network` is `None`, `features` is expected to be a multi-output network.
  num_filters : list of int
      Number of channels for the appended layers, ignored if `network`is `None`.
  sizes : iterable fo float
      Sizes of anchor boxes, this should be a list of floats, in incremental order.
      The length of `sizes` must be len(layers) + 1. For example, a two stage SSD
      model can have ``sizes = [30, 60, 90]``, and it converts to `[30, 60]` and
      `[60, 90]` for the two stages, respectively. For more details, please refer
      to original paper.
  ratios : iterable of list
      Aspect ratios of anchors in each output layer. Its length must be equals
      to the number of SSD output layers.
  steps : list of int
      Step size of anchor boxes in each output layer.
  classes : iterable of str
      Names of all categories.
  use_1x1_transition : bool
      Whether to use 1x1 convolution as transition layer between attached layers,
      it is effective reducing model capacity.
  use_bn : bool
      Whether to use BatchNorm layer after each attached convolutional layer.
  reduce_ratio : float
      Channel reduce ratio (0, 1) of the transition layer.
  min_depth : int
      Minimum channels for the transition layers.
  global_pool : bool
      Whether to attach a global average pooling layer as the last output layer.
  pretrained : bool or str
      Boolean value controls whether to load the default pretrained weights for model.
      String value represents the hashtag for a certain version of pretrained weights.
  stds : tuple of float, default is (0.1, 0.1, 0.2, 0.2)
      Std values to be divided/multiplied to box encoded values.
  nms_thresh : float, default is 0.45.
      Non-maximum suppression threshold. You can specify < 0 or > 1 to disable NMS.
  nms_topk : int, default is 400
      Apply NMS to top k detection results, use -1 to disable so that every Detection
       result is used in NMS.
  post_nms : int, default is 100
      Only return top `post_nms` detection results, the rest is discarded. The number is
      based on COCO dataset which has maximum 100 objects per image. You can adjust this
      number if expecting more objects. You can use -1 to return all detections.
  anchor_alloc_size : tuple of int, default is (128, 128)
      For advanced users. Define `anchor_alloc_size` to generate large enough anchor
      maps, which will later saved in parameters. During inference, we support arbitrary
      input image by cropping corresponding area of the anchor map. This allow us
      to export to symbol so we can run it in c++, scalar, etc.
  ctx : mx.Context
      Network context.
  norm_layer : object
      Normalization layer used (default: :class:`mxnet.gluon.nn.BatchNorm`)
      Can be :class:`mxnet.gluon.nn.BatchNorm` or :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
      This will only apply to base networks that has `norm_layer` specified, will ignore if the
      base network (e.g. VGG) don't accept this argument.
  norm_kwargs : dict
      Additional `norm_layer` arguments, for example `num_devices=4`
      for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
  root : str
      The root path for model storage, default is '~/.mxnet/models'
  minimal_opset : bool
      We sometimes add special operators to accelerate training/inference, however, for exporting
      to third party compilers we want to utilize most widely used operators.
      If `minimal_opset` is `True`, the network will use a minimal set of operators good
      for e.g., `TVM`.
  predictor_kernel: tuple of int. default is (3,3)
      Dimension of predictor kernel
  predictor_pad: tuple of int. default is (1,1)
      Padding of the predictor kenrel conv.
  anchor_generator: default is SSDAnchorGenerator
      Anchor Generator to be used. The default it SSDAnchorGenerator corresponding
      to SSD published article. This argument can be used for other custom
      anchor generators. Like LiteAnchorGenerator.
class_docstr_tok: ["Single-shot","Object","Detection","Network",":","https",":","\/\/arxiv.org\/abs\/1512.02325",".","Parameters","--","--","--","--","--","network",":","string","or","None","Name","of","the","base","network",",","if","`","None","`","is","used",",","will","instantiate","the","base","network","from","`","features","`","directly","instead","of","composing",".","base_size",":","int","Base","input","size",",","it","is","speficied","so","SSD","can","support","dynamic","input","shapes",".","features",":","list","of","str","or","mxnet.gluon.HybridBlock","Intermediate","features","to","be","extracted","or","a","network","with","multi-output",".","If","`","network","`","is","`","None","`",",","`","features","`","is","expected","to","be","a","multi-output","network",".","num_filters",":","list","of","int","Number","of","channels","for","the","appended","layers",",","ignored","if","`","network","`","is","`","None","`",".","sizes",":","iterable","fo","float","Sizes","of","anchor","boxes",",","this","should","be","a","list","of","floats",",","in","incremental","order",".","The","length","of","`","sizes","`","must","be","len","(","layers",")","+","1",".","For","example",",","a","two","stage","SSD","model","can","have","``","sizes","=","[","30",",","60",",","90","]","``",",","and","it","converts","to","`","[","30",",","60","]","`","and","`","[","60",",","90","]","`","for","the","two","stages",",","respectively",".","For","more","details",",","please","refer","to","original","paper",".","ratios",":","iterable","of","list","Aspect","ratios","of","anchors","in","each","output","layer",".","Its","length","must","be","equals","to","the","number","of","SSD","output","layers",".","steps",":","list","of","int","Step","size","of","anchor","boxes","in","each","output","layer",".","classes",":","iterable","of","str","Names","of","all","categories",".","use_1x1_transition",":","bool","Whether","to","use","1x1","convolution","as","transition","layer","between","attached","layers",",","it","is","effective","reducing","model","capacity",".","use_bn",":","bool","Whether","to","use","BatchNorm","layer","after","each","attached","convolutional","layer",".","reduce_ratio",":","float","Channel","reduce","ratio","(","0",",","1",")","of","the","transition","layer",".","min_depth",":","int","Minimum","channels","for","the","transition","layers",".","global_pool",":","bool","Whether","to","attach","a","global","average","pooling","layer","as","the","last","output","layer",".","pretrained",":","bool","or","str","Boolean","value","controls","whether","to","load","the","default","pretrained","weights","for","model",".","String","value","represents","the","hashtag","for","a","certain","version","of","pretrained","weights",".","stds",":","tuple","of","float",",","default","is","(","0.1",",","0.1",",","0.2",",","0.2",")","Std","values","to","be","divided\/multiplied","to","box","encoded","values",".","nms_thresh",":","float",",","default","is","0.45",".","Non-maximum","suppression","threshold",".","You","can","specify","<","0","or",">","1","to","disable","NMS",".","nms_topk",":","int",",","default","is","400","Apply","NMS","to","top","k","detection","results",",","use","-1","to","disable","so","that","every","Detection","result","is","used","in","NMS",".","post_nms",":","int",",","default","is","100","Only","return","top","`","post_nms","`","detection","results",",","the","rest","is","discarded",".","The","number","is","based","on","COCO","dataset","which","has","maximum","100","objects","per","image",".","You","can","adjust","this","number","if","expecting","more","objects",".","You","can","use","-1","to","return","all","detections",".","anchor_alloc_size",":","tuple","of","int",",","default","is","(","128",",","128",")","For","advanced","users",".","Define","`","anchor_alloc_size","`","to","generate","large","enough","anchor","maps",",","which","will","later","saved","in","parameters",".","During","inference",",","we","support","arbitrary","input","image","by","cropping","corresponding","area","of","the","anchor","map",".","This","allow","us","to","export","to","symbol","so","we","can","run","it","in","c++",",","scalar",",","etc",".","ctx",":","mx.Context","Network","context",".","norm_layer",":","object","Normalization","layer","used","(","default",":",":","class",":","`","mxnet.gluon.nn.BatchNorm","`",")","Can","be",":","class",":","`","mxnet.gluon.nn.BatchNorm","`","or",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`",".","This","will","only","apply","to","base","networks","that","has","`","norm_layer","`","specified",",","will","ignore","if","the","base","network","(","e.g",".","VGG",")","do","n't","accept","this","argument",".","norm_kwargs",":","dict","Additional","`","norm_layer","`","arguments",",","for","example","`","num_devices=4","`","for",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`",".","root",":","str","The","root","path","for","model","storage",",","default","is","'~\/.mxnet\/models'","minimal_opset",":","bool","We","sometimes","add","special","operators","to","accelerate","training\/inference",",","however",",","for","exporting","to","third","party","compilers","we","want","to","utilize","most","widely","used","operators",".","If","`","minimal_opset","`","is","`","True","`",",","the","network","will","use","a","minimal","set","of","operators","good","for","e.g.",",","`","TVM","`",".","predictor_kernel",":","tuple","of","int",".","default","is","(","3,3",")","Dimension","of","predictor","kernel","predictor_pad",":","tuple","of","int",".","default","is","(","1,1",")","Padding","of","the","predictor","kenrel","conv",".","anchor_generator",":","default","is","SSDAnchorGenerator","Anchor","Generator","to","be","used",".","The","default","it","SSDAnchorGenerator","corresponding","to","SSD","published","article",".","This","argument","can","be","used","for","other","custom","anchor","generators",".","Like","LiteAnchorGenerator","."]
docstr: Hybrid forward
docstr_tok: ["Hybrid","forward"]
code: def hybrid_forward(self, F, x):
      """Hybrid forward"""
      features = self.features(x)
      cls_preds = [
          F.flatten(F.transpose(cp(feat), (0, 2, 3, 1)))
          for feat, cp in zip(features, self.class_predictors)
      ]
      box_preds = [
          F.flatten(F.transpose(bp(feat), (0, 2, 3, 1)))
          for feat, bp in zip(features, self.box_predictors)
      ]
      anchors = [
          F.reshape(ag(feat), shape=(1, -1))
          for feat, ag in zip(features, self.anchor_generators)
      ]
      cls_preds = F.concat(*cls_preds, dim=1).reshape(
          (0, -1, self.num_classes + 1)
      )
      box_preds = F.concat(*box_preds, dim=1).reshape((0, -1, 4))
      anchors = F.concat(*anchors, dim=1).reshape((1, -1, 4))
      if autograd.is_training():
          return [cls_preds, box_preds, anchors]
      bboxes = self.bbox_decoder(box_preds, anchors)
      cls_ids, scores = self.cls_decoder(F.softmax(cls_preds, axis=-1))
      results = []
      for i in range(self.num_classes):
          cls_id = cls_ids.slice_axis(axis=-1, begin=i, end=i + 1)
          score = scores.slice_axis(axis=-1, begin=i, end=i + 1)
          # per class results
          per_result = F.concat(*[cls_id, score, bboxes], dim=-1)
          results.append(per_result)
      result = F.concat(*results, dim=1)
      if self.nms_thresh > 0 and self.nms_thresh < 1:
          result = F.contrib.box_nms(
              result,
              overlap_thresh=self.nms_thresh,
              topk=self.nms_topk,
              valid_thresh=0.01,
              id_index=0,
              score_index=1,
              coord_start=2,
              force_suppress=False,
          )
          if self.post_nms > 0:
              result = result.slice_axis(
                  axis=1, begin=0, end=self.post_nms
              )
      ids = F.slice_axis(result, axis=2, begin=0, end=1)
      scores = F.slice_axis(result, axis=2, begin=1, end=2)
      bboxes = F.slice_axis(result, axis=2, begin=2, end=6)
      return ids, scores, bboxes
  
imports: from __future__ import absolute_import
  import os
  import warnings
  import mxnet
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon import HybridBlock
  from ...nn.feature import FeatureExpander
  from .anchor import SSDAnchorGenerator
  from ...nn.predictor import ConvPredictor
  from ...nn.coder import MultiPerClassDecoder, NormalizedBoxCenterDecoder
  from .vgg_atrous import vgg16_atrous_300, vgg16_atrous_512
label_desc: Use image node_id 4 for calling the SSD obj's underlying member method code with example usage: obj.hybrid_forward(F, x) and returns: ids,  scores,  bboxes, list