code: def test_mmdet_object_detection_inference_basics(checkpoint_name):
      mmdet_image_name = download_sample_images()
  
      predictor = MultiModalPredictor(
          hyperparameters={
              "model.mmdet_image.checkpoint_name": checkpoint_name,
              "env.num_gpus": -1,  # currently mmdet only support single gpu inference
          },
          problem_type="object_detection",
      )
  
      # Inference on list format data
      pred = predictor.predict(
          [mmdet_image_name] * 20
      )  # test batch inference
      assert len(pred) == 20  # test data size is 20
  
      # Inference on single image path
      pred = predictor.predict(
          mmdet_image_name
      )  # test single entry data inference
      assert len(pred) == 1  # test data size is 1
  
      # Inference on dict format data
      pred = predictor.predict(
          {"image": [mmdet_image_name] * 10}
      )  # test batch inference
      assert len(pred) == 10  # test data size is 10
  
      data_dir = download_sample_dataset()
  
      test_path = os.path.join(
          data_dir, "Annotations", "test_cocoformat.json"
      )
      test_path_with_images_only = os.path.join(
          data_dir, "Annotations", "test_cocoformat_nolabel.json"
      )
      with open(test_path, "r") as f:
          test_data = json.load(f)
      test_data_images_only = {}
      test_data_images_only["images"] = test_data["images"][:100]
      with open(test_path_with_images_only, "w+") as f_wo_ann:
          json.dump(test_data_images_only, f_wo_ann)
  
      # Inference on COCO format data
      test_df = from_coco_or_voc(test_path)
  
      # Inference on dataframe format data
      pred = predictor.predict(test_df.iloc[:100])
  
      # Inference on data without annotations
      pred = predictor.predict(test_path_with_images_only)
  
file_path: autogluon/multimodal/tests/unittests/others/test_object_detection.py
imports: import json
  import os
  import pytest
  import requests
  from PIL import Image
  from autogluon.core.utils.loaders import load_zip
  from autogluon.multimodal import MultiModalPredictor
  from autogluon.multimodal.utils import from_coco_or_voc
label_desc: Use image node_id 4 for calling a global function with example usage: test_mmdet_object_detection_inference_basics(checkpoint_name) without return types