code: def test_calc_semantic_segmentation_confusion(self):
      n_class = 2
      pred_labels = np.random.randint(0, n_class, size=(10, 16, 16))
      gt_labels = np.random.randint(-1, n_class, size=(10, 16, 16))
      expected = np.zeros((n_class, n_class), dtype=np.int64)
      expected[0, 0] = np.sum(
          np.logical_and(gt_labels == 0, pred_labels == 0)
      )
      expected[0, 1] = np.sum(
          np.logical_and(gt_labels == 0, pred_labels == 1)
      )
      expected[1, 0] = np.sum(
          np.logical_and(gt_labels == 1, pred_labels == 0)
      )
      expected[1, 1] = np.sum(
          np.logical_and(gt_labels == 1, pred_labels == 1)
      )
  
      confusion = calc_semantic_segmentation_confusion(
          pred_labels, gt_labels
      )
      np.testing.assert_equal(confusion, expected)
  
file_path: chainercv/tests/evaluations_tests/test_eval_semantic_segmentation.py
imports: from __future__ import division
  import unittest
  import numpy
  from chainercv.evaluations import calc_semantic_segmentation_confusion
  from chainercv.evaluations import calc_semantic_segmentation_iou
  from chainercv.evaluations import eval_semantic_segmentation
  from chainercv.utils import testing
label_desc: Use image node_id 1 for calling the TestCalcSemanticSegmentationConfusion obj's underlying member method code with example usage: obj.test_calc_semantic_segmentation_confusion() without return types