class_docstr: Instance segmentation metric for COCO bbox and segm task.
  Will return box summary, box metric, seg summary and seg metric.
  
  Parameters
  ----------
  dataset : instance of gluoncv.data.COCOInstance
      The validation dataset.
  save_prefix : str
      Prefix for the saved JSON results.
  use_time : bool
      Append unique datetime string to created JSON file name if ``True``.
  cleanup : bool
      Remove created JSON file if ``True``. When cleanup is True, we do not output json to save
      computation.
  use_ext : bool
      Whether to use external module built by NVIDIA, which is significantly faster.
      Make sure NVIDIA MSCOCO API is installed!
  starting_id : int, default is 0
      If using distributed evaluation, it need to be set to the start of each shard.
  score_thresh : float
      Detection results with confident scores smaller than ``score_thresh`` will
      be discarded before saving to results.
class_docstr_tok: ["Instance","segmentation","metric","for","COCO","bbox","and","segm","task",".","Will","return","box","summary",",","box","metric",",","seg","summary","and","seg","metric",".","Parameters","--","--","--","--","--","dataset",":","instance","of","gluoncv.data.COCOInstance","The","validation","dataset",".","save_prefix",":","str","Prefix","for","the","saved","JSON","results",".","use_time",":","bool","Append","unique","datetime","string","to","created","JSON","file","name","if","``","True","``",".","cleanup",":","bool","Remove","created","JSON","file","if","``","True","``",".","When","cleanup","is","True",",","we","do","not","output","json","to","save","computation",".","use_ext",":","bool","Whether","to","use","external","module","built","by","NVIDIA",",","which","is","significantly","faster",".","Make","sure","NVIDIA","MSCOCO","API","is","installed","!","starting_id",":","int",",","default","is","0","If","using","distributed","evaluation",",","it","need","to","be","set","to","the","start","of","each","shard",".","score_thresh",":","float","Detection","results","with","confident","scores","smaller","than","``","score_thresh","``","will","be","discarded","before","saving","to","results","."]
docstr: Use coco to get real scores. 
docstr_tok: ["Use","coco","to","get","real","scores","."]
code: def _update(self, annType="bbox"):
      """Use coco to get real scores."""
      if self._use_ext:
          self.dataset.coco.createIndex(use_ext=True)
          if annType == "bbox":
              pred = self.dataset.coco.loadRes(
                  self._bbox_filename, use_ext=True
              )
          else:
              pred = self.dataset.coco.loadRes(
                  self._segm_filename, use_ext=True
              )
      else:
          if self._results is not None and not self._dump_to_file:
              pred = self.dataset.coco.loadRes(self._results)
          else:
              pred = self.dataset.coco.loadRes(self._filename)
      gt = self.dataset.coco
      # lazy import pycocotools
      from ...data.mscoco.utils import try_import_pycocotools
  
      try_import_pycocotools()
      from pycocotools.cocoeval import COCOeval
  
      # only NVIDIA MSCOCO API support use_ext
      coco_eval = (
          COCOeval(gt, pred, annType, use_ext=self._use_ext)
          if self._use_ext
          else COCOeval(gt, pred, annType)
      )
      coco_eval.evaluate()
      coco_eval.accumulate()
      names, values = [], []
      names.append("~~~~ Summary {} metrics ~~~~\n".format(annType))
      # catch coco print string, don't want directly print here
      _stdout = sys.stdout
      sys.stdout = io.StringIO()
      coco_eval.summarize()
      coco_summary = sys.stdout.getvalue()
      sys.stdout = _stdout
      values.append(str(coco_summary).strip())
      names.append("~~~~ Mean AP for {} ~~~~\n".format(annType))
      values.append("{:.1f}".format(100 * self._get_ap(coco_eval)))
      return names, values
  
file_path: gluon-cv/gluoncv/utils/metrics/coco_instance.py
imports: from __future__ import absolute_import
  import io
  import sys
  import warnings
  from os import path
  import numpy
  import mxnet
label_desc: Use image node_id 6 for calling the COCOInstanceMetric obj's underlying member method code with example usage: obj._update(annType) and returns: names,  values