class_docstr: Metric with predicted object information by the detector
code: def update(self, labels, preds):
      if labels is None or preds is None:
          self.num_inst += 1
          return
      preds = preds[preds[:, 1].argsort()[::-1]]
      m = min(self.topk, len(preds))
      count = 0
      gt_edge_num = labels.shape[0]
      label_matched = [False for label in labels]
      for i in range(m):
          pred = preds[i]
          for j in range(gt_edge_num):
              if label_matched[j]:
                  continue
              label = labels[j]
              if (
                  int(label[2]) == int(pred[2])
                  and int(label[3]) == int(pred[3])
                  and int(label[4]) == int(pred[4])
                  and triplet_iou_thresh(pred, label, self.iou_thresh)
              ):
                  count += 1
                  label_matched[j] = True
      total = labels.shape[0]
      self.sum_metric += count / total
      self.num_inst += 1
  
imports: import logging
  import time
  from operator import attrgetter, itemgetter
  import dgl
  import mxnet
  import numpy
  from dgl.nn.mxnet import GraphConv
  from dgl.utils import toindex
  from gluoncv.data.batchify import Pad
  from gluoncv.model_zoo import get_model
  from mxnet import gluon, nd
  from mxnet.gluon import nn
label_desc: Use image node_id 2 for calling the SGDet obj's underlying member method code with example usage: obj.update(labels, preds) without return types