code: def test_from_folders(tmpdir):
      tmp_dir = Path(tmpdir)
  
      # create random dummy data
  
      os.makedirs(str(tmp_dir / "images"))
      os.makedirs(str(tmp_dir / "targets"))
  
      images = [
          str(tmp_dir / "images" / "img1.png"),
          str(tmp_dir / "images" / "img2.png"),
          str(tmp_dir / "images" / "img3.png"),
      ]
  
      targets = [
          str(tmp_dir / "targets" / "img1.png"),
          str(tmp_dir / "targets" / "img2.png"),
          str(tmp_dir / "targets" / "img3.png"),
      ]
  
      num_classes: int = 2
      img_size: Tuple[int, int] = (128, 128)
      create_random_data(images, targets, img_size, num_classes)
  
      # instantiate the data module
  
      dm = SemanticSegmentationData.from_folders(
          train_folder=str(tmp_dir / "images"),
          train_target_folder=str(tmp_dir / "targets"),
          val_folder=str(tmp_dir / "images"),
          val_target_folder=str(tmp_dir / "targets"),
          test_folder=str(tmp_dir / "images"),
          test_target_folder=str(tmp_dir / "targets"),
          batch_size=2,
          num_workers=0,
          num_classes=num_classes,
      )
      assert dm is not None
      assert dm.train_dataloader() is not None
      assert dm.val_dataloader() is not None
      assert dm.test_dataloader() is not None
  
      # check training data
      data = next(iter(dm.train_dataloader()))
      imgs, labels = data[DataKeys.INPUT], data[DataKeys.TARGET]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2, 128, 128)
  
      # check val data
      data = next(iter(dm.val_dataloader()))
      imgs, labels = data[DataKeys.INPUT], data[DataKeys.TARGET]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2, 128, 128)
  
      # check test data
      data = next(iter(dm.test_dataloader()))
      imgs, labels = data[DataKeys.INPUT], data[DataKeys.TARGET]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2, 128, 128)
  
imports: import os
  from pathlib import Path
  from typing import Callable, Dict, List, Tuple
  import numpy
  import pytest
  import torch
  from flash import Trainer
  from flash.core.data.io.input import DataKeys
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.transforms import ApplyToKeys
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _MATPLOTLIB_AVAILABLE, _PIL_AVAILABLE, _SEGMENTATION_MODELS_AVAILABLE, _TOPIC_IMAGE_AVAILABLE
  from flash.image import SemanticSegmentation, SemanticSegmentationData
label_desc: Use image node_id 3 for calling the TestSemanticSegmentationData obj's underlying member method code with example usage: obj.test_from_folders(tmpdir) without return types