code: def test_export_coreml(self):
      from PIL import Image
      import coremltools
      import platform
  
      filename = tempfile.NamedTemporaryFile(suffix=".mlmodel").name
      self.model.export_coreml(
          filename, include_non_maximum_suppression=False
      )
  
      # Test metadata
      coreml_model = coremltools.models.MLModel(filename)
      metadata = coreml_model.user_defined_metadata
  
      self.assertEqual(
          metadata["com.github.apple.turicreate.version"],
          tc.__version__,
      )
      self.assertEqual(
          metadata["com.github.apple.os.platform"], platform.platform()
      )
      self.assertEqual(metadata["type"], "object_detector")
      self.assertEqual(metadata["version"], "1")
      self.assertEqual(metadata["classes"], ",".join(sorted(_CLASSES)))
      self.assertEqual(metadata["feature"], self.feature)
      self.assertEqual(
          metadata["include_non_maximum_suppression"], "False"
      )
      self.assertEqual(metadata["annotations"], "annotation")
      self.assertEqual(metadata["max_iterations"], "1")
      self.assertEqual(metadata["model"], "YOLOv2")
      self.assertEqual(metadata["training_iterations"], "1")
  
      expected_result = (
          "One shot object detector created by Turi Create (version %s)"
          % (tc.__version__)
      )
      self.assertEquals(expected_result, coreml_model.short_description)
  
      # Test prediction
      img = self.train[0:1][self.feature][0]
      img_fixed = tc.image_analysis.resize(img, 416, 416, 3)
      pil_img = Image.fromarray(img_fixed.pixel_data)
      if _mac_ver() >= (10, 13):
          ret = coreml_model.predict(
              {self.feature: pil_img}, usesCPUOnly=True
          )
          self.assertEqual(ret["coordinates"].shape[1], 4)
          self.assertEqual(ret["confidence"].shape[1], len(_CLASSES))
          self.assertEqual(
              ret["coordinates"].shape[0], ret["confidence"].shape[0]
          )
  
      # Test export without non max supression
      filename2 = tempfile.NamedTemporaryFile(suffix=".mlmodel").name
      self.model.export_coreml(
          filename2, include_non_maximum_suppression=True
      )
      coreml_model = coremltools.models.MLModel(filename)
      self.assertTrue(
          coreml_model.user_defined_metadata[
              "include_non_maximum_suppression"
          ]
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import pytest
  from .None import util
  import turicreate
  import tempfile
  import numpy
  import platform
  import pytest
  import sys
  import os
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits._internal_utils import _raise_error_if_not_sarray, _mac_ver
label_desc: Use image node_id 13 for calling the OneObjectDetectorSmokeTest obj's underlying member method code with example usage: obj.test_export_coreml() without return types