code: def test_predict(art_warning, get_pytorch_object_detector):
      try:
          object_detector, x_test, _ = get_pytorch_object_detector
  
          result = object_detector.predict(x_test)
          assert list(result[0].keys()) == ["boxes", "labels", "scores"]
  
          assert result[0]["boxes"].shape == (7, 4)
          expected_detection_boxes = np.asarray(
              [4.4017954, 6.3090835, 22.128296, 27.570665]
          )
          np.testing.assert_array_almost_equal(
              result[0]["boxes"][2, :],
              expected_detection_boxes,
              decimal=3,
          )
  
          assert result[0]["scores"].shape == (7,)
          expected_detection_scores = np.asarray(
              [
                  0.3314798,
                  0.14125851,
                  0.13928168,
                  0.0996184,
                  0.08550017,
                  0.06690315,
                  0.05359321,
              ]
          )
          np.testing.assert_array_almost_equal(
              result[0]["scores"][:10],
              expected_detection_scores,
              decimal=6,
          )
  
          assert result[0]["labels"].shape == (7,)
          expected_detection_classes = np.asarray(
              [72, 79, 1, 72, 78, 72, 82]
          )
          np.testing.assert_array_almost_equal(
              result[0]["labels"][:10],
              expected_detection_classes,
              decimal=6,
          )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/estimators/object_detection/test_pytorch_object_detector.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import numpy
  import pytest
  from tests.utils import ARTTestException
label_desc: Use image node_id 1 for calling a global function with example usage: test_predict(art_warning, get_pytorch_object_detector) without return types