code: def _create_synth_coco_dataset(tmpdir):
      train_dir = Path(tmpdir / "train")
      train_dir.mkdir()
  
      (train_dir / "images").mkdir()
      Image.new("RGB", (1920, 1080)).save(
          train_dir / "images" / "sample_one.png"
      )
      Image.new("RGB", (1920, 1080)).save(
          train_dir / "images" / "sample_two.png"
      )
  
      (train_dir / "annotations").mkdir()
      dummy_json = train_dir / "annotations" / "sample.json"
  
      train_folder = os.fspath(Path(train_dir / "images"))
      coco_ann_path = os.fspath(dummy_json)
      _create_dummy_coco_json(coco_ann_path)
  
      return train_folder, coco_ann_path
  
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 2 for calling a global function with example usage: _create_synth_coco_dataset(tmpdir) and returns: train_folder,  coco_ann_path