class_docstr: The ``ClassificationInputMixin`` class provides utility methods for handling classification targets.
  :class:`~flash.core.data.io.input.Input` objects that extend ``ClassificationInputMixin`` should do the following:
  
  * In the ``load_data`` method, include a call to ``load_target_metadata``. This will determine the format of the
    targets and store metadata like ``labels`` and ``num_classes``.
  * In the ``load_sample`` method, use ``format_target`` to convert the target to a standard format for use with our
    tasks.
class_docstr_tok: ["The","``","ClassificationInputMixin","``","class","provides","utility","methods","for","handling","classification","targets",".",":","class",":","`","~flash.core.data.io.input.Input","`","objects","that","extend","``","ClassificationInputMixin","``","should","do","the","following",":","*","In","the","``","load_data","``","method",",","include","a","call","to","``","load_target_metadata","``",".","This","will","determine","the","format","of","the","targets","and","store","metadata","like","``","labels","``","and","``","num_classes","``",".","*","In","the","``","load_sample","``","method",",","use","``","format_target","``","to","convert","the","target","to","a","standard","format","for","use","with","our","tasks","."]
docstr: Determine the target format and store the ``labels`` and ``num_classes``.
  
  Args:
      targets: The list of targets.
      target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter`
          rather than inferring from the targets.
      add_background: If ``True``, a background class will be inserted as class zero if ``labels`` and
          ``num_classes`` are being inferred.
docstr_tok: ["Determine","the","target","format","and","store","the","``","labels","``","and","``","num_classes","``",".","Args",":","targets",":","The","list","of","targets",".","target_formatter",":","Optionally","provide","a",":","class",":","`","~flash.core.data.utilities.classification.TargetFormatter","`","rather","than","inferring","from","the","targets",".","add_background",":","If","``","True","``",",","a","background","class","will","be","inserted","as","class","zero","if","``","labels","``","and","``","num_classes","``","are","being","inferred","."]
code: def load_target_metadata(
      self,
      targets: Optional[List[Any]],
      target_formatter: Optional[TargetFormatter] = None,
      add_background: bool = False,
  ) -> None:
      """Determine the target format and store the ``labels`` and ``num_classes``.
  
      Args:
          targets: The list of targets.
          target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter`
              rather than inferring from the targets.
          add_background: If ``True``, a background class will be inserted as class zero if ``labels`` and
              ``num_classes`` are being inferred.
  
      """
      self.target_formatter = target_formatter
      if target_formatter is None and targets is not None:
          self.target_formatter = get_target_formatter(
              targets, add_background=add_background
          )
  
      if self.target_formatter is not None:
          self.multi_label = self.target_formatter.multi_label
          self.labels = self.target_formatter.labels
          self.num_classes = self.target_formatter.num_classes
  
imports: from typing import Any, List, Optional
  from flash.core.data.properties import Properties
  from flash.core.data.utilities.classification import TargetFormatter, get_target_formatter
label_desc: Use image node_id 1 for calling the ClassificationInputMixin obj's underlying member method code with example usage: obj.load_target_metadata(targets, target_formatter, add_background) without return types