code: def test_object_detector(self):
      hparams = object_detector.HParams(
          epochs=1,
          batch_size=2,
          learning_rate=0.9,
          shuffle=False,
          export_dir=self.create_tempdir(),
      )
      options = object_detector.ObjectDetectorOptions(
          supported_model=object_detector.SupportedModels.MOBILENET_V2,
          hparams=hparams,
      )
      # Test `create``
      model = object_detector.ObjectDetector.create(
          train_data=self.data,
          validation_data=self.data,
          options=options,
      )
      losses, coco_metrics = model.evaluate(self.data)
      self._assert_ap_greater(coco_metrics)
      self.assertFalse(model._is_qat)
      # Test float export_model
      model.export_model()
      output_metadata_file = os.path.join(
          options.hparams.export_dir, "metadata.json"
      )
      output_tflite_file = os.path.join(
          options.hparams.export_dir, "model.tflite"
      )
      self.assertTrue(os.path.exists(output_tflite_file))
      self.assertGreater(os.path.getsize(output_tflite_file), 0)
      self.assertTrue(os.path.exists(output_metadata_file))
      self.assertGreater(os.path.getsize(output_metadata_file), 0)
  
      # Test `quantization_aware_training`
      qat_hparams = object_detector.QATHParams(
          learning_rate=0.9,
          batch_size=2,
          epochs=1,
          decay_steps=6,
          decay_rate=0.96,
      )
      model.quantization_aware_training(
          self.data, self.data, qat_hparams
      )
      qat_losses, qat_coco_metrics = model.evaluate(self.data)
      self._assert_ap_greater(qat_coco_metrics)
      self.assertNotAllEqual(losses, qat_losses)
      self.assertTrue(model._is_qat)
      model.export_model("model_qat.tflite")
      output_metadata_file = os.path.join(
          options.hparams.export_dir, "metadata.json"
      )
      output_tflite_file = os.path.join(
          options.hparams.export_dir, "model_qat.tflite"
      )
      self.assertTrue(os.path.exists(output_tflite_file))
      self.assertGreater(os.path.getsize(output_tflite_file), 0)
      self.assertLess(os.path.getsize(output_tflite_file), 3500000)
      self.assertTrue(os.path.exists(output_metadata_file))
      self.assertGreater(os.path.getsize(output_metadata_file), 0)
  
      # Load float ckpt test
      model.restore_float_ckpt()
      losses_2, _ = model.evaluate(self.data)
      self.assertAllEqual(losses, losses_2)
      self.assertNotAllEqual(qat_losses, losses_2)
      self.assertFalse(model._is_qat)
  
file_path: mediapipe/mediapipe/model_maker/python/vision/object_detector/object_detector_test.py
imports: import os
  import tempfile
  from unittest import mock
  from absl.testing import parameterized
  import tensorflow
  from mediapipe.model_maker.python.vision import object_detector
  from mediapipe.tasks.python.test import test_utils
label_desc: Use image node_id 2 for calling the ObjectDetectorTest obj's underlying member method code with example usage: obj.test_object_detector() without return types