code: def test_predict_mask(art_warning, get_pytorch_object_detector_mask):
      try:
          object_detector, x_test, _ = get_pytorch_object_detector_mask
  
          result = object_detector.predict(x_test)
          assert list(result[0].keys()) == [
              "boxes",
              "labels",
              "scores",
              "masks",
          ]
  
          assert result[0]["boxes"].shape == (4, 4)
          expected_detection_boxes = np.asarray(
              [8.62889, 11.735134, 16.353355, 27.565004]
          )
          np.testing.assert_array_almost_equal(
              result[0]["boxes"][2, :],
              expected_detection_boxes,
              decimal=3,
          )
  
          assert result[0]["scores"].shape == (4,)
          expected_detection_scores = np.asarray(
              [0.45197296, 0.12707493, 0.082677, 0.05386855]
          )
          np.testing.assert_array_almost_equal(
              result[0]["scores"][:10],
              expected_detection_scores,
              decimal=4,
          )
  
          assert result[0]["labels"].shape == (4,)
          expected_detection_classes = np.asarray([72, 72, 1, 1])
          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 2 for calling a global function with example usage: test_predict_mask(art_warning, get_pytorch_object_detector_mask) without return types