code: def test_detection_fiftyone(tmpdir, head, backbone):
      train_dataset = _create_synth_fiftyone_dataset(tmpdir)
  
      datamodule = ObjectDetectionData.from_fiftyone(
          train_dataset=train_dataset, batch_size=1
      )
      model = ObjectDetector(
          head=head,
          backbone=backbone,
          num_classes=datamodule.num_classes,
      )
  
      trainer = flash.Trainer(
          fast_dev_run=True, gpus=torch.cuda.device_count()
      )
  
      trainer.finetune(model, datamodule, strategy="freeze")
  
      test_image_one = os.fspath(tmpdir / "test_one.png")
      test_image_two = os.fspath(tmpdir / "test_two.png")
  
      Image.new("RGB", (512, 512)).save(test_image_one)
      Image.new("RGB", (512, 512)).save(test_image_two)
  
      datamodule = ObjectDetectionData.from_files(
          predict_files=[str(test_image_one), str(test_image_two)],
          batch_size=1,
      )
      trainer.predict(model, datamodule=datamodule)
  
file_path: lightning-flash/tests/image/detection/test_data_model_integration.py
imports: import os
  import flash
  import pytest
  import torch
  from flash.core.utilities.imports import _COCO_AVAILABLE, _FIFTYONE_AVAILABLE, _PIL_AVAILABLE
  from flash.image import ObjectDetector
  from flash.image.detection import ObjectDetectionData
label_desc: Use image node_id 2 for calling a global function with example usage: test_detection_fiftyone(tmpdir, head, backbone) without return types