class_docstr: Estimator implementation for Faster-RCNN.
  
  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","Faster-RCNN",".","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 = (
          self.net.short[-1]
          if isinstance(self.net.short, (tuple, list))
          else self.net.short
      )
      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):
          if len(x.shape) != 3 or x.shape[-1] != 3:
              raise ValueError(
                  "array input with shape (h, w, 3) is required for predict"
              )
          return self._predict(mx.nd.array(x))
      elif isinstance(x, mx.nd.NDArray):
          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 gluon
  from ....data.batchify import Tuple, Append
  from ....data.transforms.presets.rcnn import load_test, transform_test
  from ....data.transforms.presets.rcnn import FasterRCNNDefaultTrainTransform, FasterRCNNDefaultValTransform
  from ....model_zoo import get_model
  from ....model_zoo.rcnn.faster_rcnn.data_parallel import ForwardBackwardTask
  from ....nn.bbox import BBoxClipToImage
  from ....utils.parallel import Parallel
  from ....utils.metrics.rcnn import RPNAccMetric, RPNL1LossMetric, RCNNAccMetric, RCNNL1LossMetric
  from ....utils.metrics.voc_detection import VOC07MApMetric, VOCMApMetric
  from ..base_estimator import BaseEstimator, set_default
  from .utils import _get_lr_at_iter, _get_dataloader, _split_and_load
  from ...data.dataset import ObjectDetectionDataset
  from ..conf import _BEST_CHECKPOINT_FILE
  from ..utils import EarlyStopperOnPlateau
  from .default import FasterRCNNCfg
label_desc: Use image node_id 6 for calling the FasterRCNNEstimator obj's underlying member method code with example usage: obj._predict(x, ctx_id) and returns: valid_df, self, self, pd, y, pd