code: def test_classification(tmpdir):
      tmpdir = Path(tmpdir)
  
      (tmpdir / "a").mkdir()
      (tmpdir / "b").mkdir()
  
      image_a = str(tmpdir / "a" / "a_1.png")
      image_b = str(tmpdir / "b" / "b_1.png")
  
      _rand_image().save(image_a)
      _rand_image().save(image_b)
  
      data = ImageClassificationData.from_files(
          train_files=[image_a, image_b],
          train_targets=[0, 1],
          num_workers=0,
          batch_size=2,
          transform_kwargs={"image_size": (64, 64)},
      )
      model = ImageClassifier(num_classes=2, backbone="resnet18")
      trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True)
      trainer.finetune(model, datamodule=data, strategy="freeze")
  
file_path: lightning-flash/tests/image/classification/test_data_model_integration.py
imports: from pathlib import Path
  import numpy
  import pytest
  from flash import Trainer
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _PIL_AVAILABLE, _TOPIC_IMAGE_AVAILABLE
  from flash.image import ImageClassificationData, ImageClassifier
label_desc: Use image node_id 2 for calling a global function with example usage: test_classification(tmpdir) without return types