code: def test_image_detector_data_from_coco(tmpdir):
      train_folder, coco_ann_path = _create_synth_coco_dataset(tmpdir)
  
      datamodule = ObjectDetectionData.from_coco(
          train_folder=train_folder,
          train_ann_file=coco_ann_path,
          batch_size=1,
          transform_kwargs={"image_size": 128},
      )
  
      data = next(iter(datamodule.train_dataloader()))
      sample = data[0]
      assert sample[DataKeys.INPUT].shape == (128, 128, 3)
  
      datamodule = ObjectDetectionData.from_coco(
          train_folder=train_folder,
          train_ann_file=coco_ann_path,
          val_folder=train_folder,
          val_ann_file=coco_ann_path,
          test_folder=train_folder,
          test_ann_file=coco_ann_path,
          batch_size=1,
          num_workers=0,
          transform_kwargs={"image_size": 128},
      )
  
      data = next(iter(datamodule.val_dataloader()))
      sample = data[0]
      assert sample[DataKeys.INPUT].shape == (128, 128, 3)
  
      data = next(iter(datamodule.test_dataloader()))
      sample = data[0]
      assert sample[DataKeys.INPUT].shape == (128, 128, 3)
  
file_path: lightning-flash/tests/image/detection/test_data.py
imports: import json
  import os
  from pathlib import Path
  import pytest
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _ICEVISION_AVAILABLE, _PIL_AVAILABLE
  from flash.image.detection.data import ObjectDetectionData
label_desc: Use image node_id 6 for calling a global function with example usage: test_image_detector_data_from_coco(tmpdir) without return types