class_docstr: Estimator implementation for SSD.
  
  Parameters
  ----------
  config : dict
      Config in nested dict.
  logger : logging.Logger, default is None
      Optional logger for this estimator, can be `None` when default setting is used.
  reporter : callable, default is None
      If set, use reporter callback to report the metrics of the current estimator.
  
  Attributes
  ----------
  _logger : logging.Logger
      The customized/default logger for this estimator.
  _logdir : str
      The temporary dir for logs.
  _cfg : autocfg.dataclass
      The configurations.
class_docstr_tok: ["Estimator","implementation","for","SSD",".","Parameters","--","--","--","--","--","config",":","dict","Config","in","nested","dict",".","logger",":","logging.Logger",",","default","is","None","Optional","logger","for","this","estimator",",","can","be","`","None","`","when","default","setting","is","used",".","reporter",":","callable",",","default","is","None","If","set",",","use","reporter","callback","to","report","the","metrics","of","the","current","estimator",".","Attributes","--","--","--","--","--","_logger",":","logging.Logger","The","customized\/default","logger","for","this","estimator",".","_logdir",":","str","The","temporary","dir","for","logs",".","_cfg",":","autocfg.dataclass","The","configurations","."]
docstr: Predict an individual example.
docstr_tok: ["Predict","an","individual","example","."]
code: def _predict(self, x, ctx_id=0):
      """Predict an individual example."""
      short_size = int(self._cfg.ssd.data_shape)
      if isinstance(x, str):
          x = load_test(x, short=short_size, max_size=1024)[0]
      elif isinstance(x, Image.Image):
          return self._predict(np.array(x))
      elif isinstance(x, np.ndarray):
          return self._predict(mx.nd.array(x))
      elif isinstance(x, mx.nd.NDArray):
          if len(x.shape) != 3 or x.shape[-1] != 3:
              raise ValueError(
                  "array input with shape (h, w, 3) is required for predict"
              )
          x = transform_test(x, short=short_size, max_size=1024)[0]
      elif isinstance(x, pd.DataFrame):
          assert (
              "image" in x.columns
          ), "Expect column `image` for input images"
  
          def _predict_merge(x, ctx_id=0):
              y = self._predict(x, ctx_id=ctx_id)
              y["image"] = x
              return y
  
          return pd.concat(
              [
                  _predict_merge(xx, ctx_id=ii % len(self.ctx))
                  for ii, xx in enumerate(x["image"])
              ]
          ).reset_index(drop=True)
      elif isinstance(x, (list, tuple)):
          return pd.concat(
              [
                  self._predict(xx, ctx_id=ii % len(self.ctx))
                  for ii, xx in enumerate(x)
              ]
          ).reset_index(drop=True)
      else:
          raise ValueError("Input is not supported: {}".format(type(x)))
      height, width = x.shape[2:4]
      x = x.as_in_context(self.ctx[ctx_id])
      ids, scores, bboxes = [xx[0].asnumpy() for xx in self.net(x)]
      bboxes[:, (0, 2)] /= width
      bboxes[:, (1, 3)] /= height
      bboxes = np.clip(bboxes, 0.0, 1.0).tolist()
      df = pd.DataFrame(
          {
              "predict_class": [self.classes[int(id)] for id in ids],
              "predict_score": scores.flatten(),
              "predict_rois": [
                  {
                      "xmin": bbox[0],
                      "ymin": bbox[1],
                      "xmax": bbox[2],
                      "ymax": bbox[3],
                  }
                  for bbox in bboxes
              ],
          }
      )
      # filter out invalid (scores < 0) rows
      valid_df = df[df["predict_score"] > 0].reset_index(drop=True)
      return valid_df
  
imports: import os
  import math
  import time
  import warnings
  from PIL import Image
  import pandas
  import numpy
  import mxnet
  from mxnet import nd
  from mxnet import gluon
  from mxnet import autograd
  from mxnet.contrib import amp
  from ....None import utils
  from ....data.batchify import Tuple, Stack, Pad
  from ....utils.metrics.voc_detection import VOC07MApMetric, VOCMApMetric
  from ....model_zoo import get_model
  from ....model_zoo import custom_ssd
  from ....data.transforms.presets.ssd import SSDDefaultValTransform
  from ....data.transforms.presets.ssd import load_test, transform_test
  from ....loss import SSDMultiBoxLoss
  from .utils import _get_dataloader, _get_dali_dataloader
  from ..base_estimator import BaseEstimator, set_default
  from .default import SSDCfg
  from ...data.dataset import ObjectDetectionDataset
  from ..conf import _BEST_CHECKPOINT_FILE
  from ..utils import EarlyStopperOnPlateau
label_desc: Use image node_id 6 for calling the SSDEstimator obj's underlying member method code with example usage: obj._predict(x, ctx_id) and returns: valid_df, self, self, pd, y, pd