class_docstr: This tests the object detection metrics.
  
  Results provided from COCOAPI: AP with all IoUs causes overflow of memory,
  thus we do not check it here, but check the single value instead and the
  average of two IoUs.
  Average Precision @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.533
  Average Precision @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.916
  Average Precision @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.416
  Average Precision @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.500
  Average Precision @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.303
  Average Precision @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.701
  Average Recall @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.375
  Average Recall @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.533
  Average Recall @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.533
  Average Recall @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.500
  Average Recall @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.300
  Average Recall @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.700
code: def testMetricValuesWithLargerData(
      self, eval_config, name_list, expected_results
  ):
      extracts = [
          {
              "features": {
                  "labels": np.array(
                      [
                          [
                              [272.1, 200.23, 424.07, 480.0, 2.0],
                              [181.23, 86.28, 208.67, 159.81, 2.0],
                              [174.74, 0.0, 435.78, 220.79, 2.0],
                          ]
                      ]
                  ),
                  "predictions": np.array(
                      [
                          [
                              [
                                  271.2,
                                  178.86,
                                  429.52,
                                  459.57,
                                  2.0,
                                  0.64,
                              ],
                              [
                                  178.53,
                                  92.57,
                                  206.39,
                                  159.71,
                                  2.0,
                                  0.38,
                              ],
                              [167.96, 9.97, 442.79, 235.07, 2.0, 0.95],
                          ]
                      ]
                  ),
              }
          },
          {
              "features": {
                  "labels": np.array(
                      [
                          [
                              [473.07, 395.93, 503.07, 424.6, 1.0],
                              [204.01, 235.08, 264.85, 412.44, 2.0],
                              [0.43, 499.79, 340.22, 606.24, 2.0],
                              [204.42, 304.1, 256.93, 456.86, 2.0],
                          ]
                      ]
                  ),
                  "predictions": np.array(
                      [
                          [
                              [
                                  471.15,
                                  398.57,
                                  502.29,
                                  428.26,
                                  1.0,
                                  0.54,
                              ],
                              [
                                  198.53,
                                  242.14,
                                  263.93,
                                  427.51,
                                  2.0,
                                  0.95,
                              ],
                              [
                                  -32.86,
                                  505.75,
                                  338.82,
                                  619.66,
                                  2.0,
                                  0.17,
                              ],
                              [
                                  201.59,
                                  299.39,
                                  258.4,
                                  452.88,
                                  1.0,
                                  0.05,
                              ],
                          ]
                      ]
                  ),
              }
          },
      ]
  
      evaluators = tfma.default_evaluators(eval_config=eval_config)
      extractors = tfma.default_extractors(
          eval_shared_model=None, eval_config=eval_config
      )
  
      with beam.Pipeline() as p:
          result = (
              p
              | "LoadData" >> beam.Create(extracts)
              | "ExtractEval"
              >> tfma.ExtractAndEvaluate(
                  extractors=extractors, evaluators=evaluators
              )
          )
  
          # pylint: enable=no-value-for-parameter
  
          def check_result(got):
              try:
                  self.assertLen(got, 1)
                  got_slice_key, got_metrics = got[0]
                  self.assertEqual(got_slice_key, ())
                  self.assertLen(got_metrics, len(name_list))
                  for name, expected_result in zip(
                      name_list, expected_results
                  ):
                      key = metric_types.MetricKey(name=name)
                      self.assertIn(key, got_metrics)
                      got_metric = got_metrics[key]
                      np.testing.assert_allclose(
                          expected_result,
                          got_metric,
                          rtol=1e-3,
                          err_msg=f"This {name} metric fails.",
                      )
              except AssertionError as err:
                  raise util.BeamAssertException(err)
  
          self.assertIn("metrics", result)
          util.assert_that(
              result["metrics"], check_result, label="result"
          )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/object_detection_metrics_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow_model_analysis
  from tensorflow_model_analysis.metrics import metric_types
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the ObjectDetectionMetricsTest obj's underlying member method code with example usage: obj.testMetricValuesWithLargerData(eval_config, name_list, expected_results) without return types