class_docstr: Detection metric for COCO bbox task.
  
  Parameters
  ----------
  dataset : instance of gluoncv.data.COCODetection
      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``.
  in_vis_thresh : float
      Detection results with confident scores smaller than ``in_vis_thresh`` will
      be discarded before saving to results.
  data_shape : tuple of int, default is None
      If `data_shape` is provided as (height, width), we will rescale bounding boxes when
      saving the predictions.
      This is helpful when SSD/YOLO box predictions cannot be rescaled conveniently. Note that
      the data_shape must be fixed for all validation images.
class_docstr_tok: ["Detection","metric","for","COCO","bbox","task",".","Parameters","--","--","--","--","--","dataset",":","instance","of","gluoncv.data.COCODetection","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","``",".","in_vis_thresh",":","float","Detection","results","with","confident","scores","smaller","than","``","in_vis_thresh","``","will","be","discarded","before","saving","to","results",".","data_shape",":","tuple","of","int",",","default","is","None","If","`","data_shape","`","is","provided","as","(","height",",","width",")",",","we","will","rescale","bounding","boxes","when","saving","the","predictions",".","This","is","helpful","when","SSD\/YOLO","box","predictions","can","not","be","rescaled","conveniently",".","Note","that","the","data_shape","must","be","fixed","for","all","validation","images","."]
code: def update(self, preds, maxvals, score, imgid, *args, **kwargs):
      # import pdb; pdb.set_trace()
      num_joints = preds.shape[1]
      in_vis_thresh = self._in_vis_thresh
      for idx, kpt in enumerate(preds):
          kpt = []
          kpt_score = 0
          count = 0
          for i in range(num_joints):
              kpt += preds[idx][i].asnumpy().tolist()
              mval = float(maxvals[idx][i].asscalar())
              kpt.append(mval)
              if mval > in_vis_thresh:
                  kpt_score += mval
                  count += 1
  
          if count > 0:
              kpt_score /= count
          rescore = kpt_score * score[idx].asscalar()
  
          self._results.append(
              {
                  "image_id": int(imgid[idx].asscalar()),
                  "category_id": 1,
                  "keypoints": kpt,
                  "score": rescore,
              }
          )
          self._recorded_ids[int(imgid[idx].asscalar())] = True
  
file_path: gluon-cv/gluoncv/utils/metrics/coco_keypoints.py
imports: from __future__ import absolute_import
  import os
  from os import path
  from collections import OrderedDict
  import warnings
label_desc: Use image node_id 6 for calling the COCOKeyPointsMetric obj's underlying member method code with example usage: obj.update(preds, maxvals, score, imgid) without return types