code: def load_data(
      self,
      root: str,
      ann_file: Optional[str] = None,
      parser: Optional[Type["Parser"]] = None,
      parser_kwargs: Optional[Dict[str, Any]] = None,
  ) -> List[Dict[str, Any]]:
      parser_kwargs = {} if parser_kwargs is None else parser_kwargs
      unwrapped_parser = getattr(parser, "func", parser)
      if inspect.isclass(unwrapped_parser) and issubclass(
          unwrapped_parser, Parser
      ):
          parser = parser(ann_file, root, **parser_kwargs)
      elif isinstance(unwrapped_parser, Callable):
          parser = parser(root, **parser_kwargs)
      else:
          raise ValueError(
              "The parser must be a callable or an IceVision Parser type."
          )
      class_map = getattr(parser, "class_map", None)
      if class_map is not None:
          self.num_classes = class_map.num_classes
          self.labels = [
              class_map.get_by_id(i) for i in range(self.num_classes)
          ]
      records = parser.parse(data_splitter=SingleSplitSplitter())
      return [{DataKeys.INPUT: record} for record in records[0]]
  
file_path: lightning-flash/src/flash/core/integrations/icevision/data.py
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Type, Union
  import numpy
  from flash.core.data.io.input import DataKeys, Input
  from flash.core.data.utilities.loading import IMG_EXTENSIONS, NP_EXTENSIONS, load_image
  from flash.core.data.utilities.paths import list_valid_files
  from flash.core.integrations.icevision.transforms import from_icevision_record
  from flash.core.utilities.imports import _ICEVISION_AVAILABLE, requires
label_desc: Use image node_id 1 for calling the IceVisionInput obj's underlying member method code with example usage: obj.load_data(root, ann_file, parser, parser_kwargs) and returns: unknown