code: def test_image_detector_data_from_files(tmpdir):
      predict_files = _create_synth_files_dataset(tmpdir)
      datamodule = InstanceSegmentationData.from_files(
          predict_files=predict_files,
          batch_size=2,
          transform_kwargs={"image_size": (128, 128)},
      )
      data = next(iter(datamodule.predict_dataloader()))
      sample = data[0]
      assert sample[DataKeys.INPUT].shape == (128, 128, 3)
  
file_path: lightning-flash/tests/image/instance_segm/test_data.py
imports: import numpy
  import pytest
  import torch
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _TOPIC_IMAGE_AVAILABLE
  from flash.image.instance_segmentation import InstanceSegmentationData
  from flash.image.instance_segmentation.data import InstanceSegmentationOutputTransform
  from tests.image.detection.test_data import _create_synth_files_dataset, _create_synth_folders_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_image_detector_data_from_files(tmpdir) without return types