code: def test_localization_confusion(
      gts, preds, iou_thresh, recall, precision, mean_iou
  ):
      metric = metrics.LocalizationConfusion(iou_thresh)
      for _gts, _preds in zip(gts, preds):
          metric.update(
              np.asarray(_gts),
              np.zeros((0, 4))
              if _preds is None
              else np.asarray(_preds),
          )
      assert metric.summary() == (recall, precision, mean_iou)
      metric.reset()
      assert (
          metric.num_gts
          == metric.num_preds
          == metric.matches
          == metric.tot_iou
          == 0
      )
  
file_path: doctr/tests/common/test_utils_metrics.py
imports: import numpy
  import pytest
  from doctr.utils import metrics
label_desc: Use image node_id 6 for calling a global function with example usage: test_localization_confusion(gts, preds, iou_thresh, recall, precision, mean_iou) without return types