code: def test_values(self):
      # empty sequences
      errors = calc_relative_errors([], [])
      self.assertTrue(np.allclose(errors, []))
      # detections relative to annotations
      errors = calc_relative_errors(DETECTIONS, ANNOTATIONS)
      # np.abs(1 - (errors / annotations[matches]))
      # det: [0.99, 1.45, 2.01, 2.015,            3.1,  8.1])
      # tar: [1,    1.5,  2.0,  2.03,  2.05, 2.5, 3])
      correct = np.abs(
          np.asarray(
              [
                  1 + 0.01 / 1,
                  1 + 0.05 / 1.5,
                  1 - 0.01 / 2,
                  1 + 0.015 / 2.03,
                  1 - 0.1 / 3,
                  1 - 5.1 / 3,
              ]
          )
      )
      self.assertTrue(np.allclose(errors, correct))
      # same but with matches given
      errors = calc_relative_errors(DETECTIONS, ANNOTATIONS, MATCHES)
      self.assertTrue(np.allclose(errors, correct))
      # annotations relative to detections
      errors = calc_relative_errors(ANNOTATIONS, DETECTIONS)
      correct = np.abs(
          np.asarray(
              [
                  1 - 0.01 / 0.99,
                  1 - 0.05 / 1.45,
                  1 + 0.01 / 2.01,
                  1 - 0.015 / 2.015,
                  1 - 0.035 / 2.015,
                  1 - 0.485 / 2.015,
                  1 + 0.1 / 3.1,
              ]
          )
      )
      self.assertTrue(np.allclose(errors, correct))
  
imports: from __future__ import absolute_import, division, print_function
  import math
  import unittest
  from collections import OrderedDict
  from madmom.evaluation import *
label_desc: Use image node_id 2 for calling the TestCalcRelativeErrorsFunction obj's underlying member method code with example usage: obj.test_values() without return types