class_docstr: A :class:`.Output` which converts the model outputs to FiftyOne classification format.
  
  Args:
      labels: A list of labels, assumed to map the class index to the label for that class.
      multi_label: If true, treats outputs as multi label logits.
      threshold: A threshold to use to filter candidate labels. In the single label case, predictions below this
          threshold will be replaced with None
      store_logits: Boolean determining whether to store logits in the FiftyOne labels
      return_filepath: Boolean determining whether to return a dict
          containing filepath and FiftyOne labels (True) or only a
          list of FiftyOne labels (False)
code: def transform(
      self,
      sample: Any,
  ) -> Union[Classification, Classifications, Dict[str, Any]]:
      pred = (
          sample[DataKeys.PREDS] if isinstance(sample, Dict) else sample
      )
      pred = torch.tensor(pred)
  
      logits = None
      if self.store_logits:
          logits = pred.tolist()
  
      if self.multi_label:
          one_hot = (pred.sigmoid() > self.threshold).int().tolist()
          classes = []
          for index, value in enumerate(one_hot):
              if value == 1:
                  classes.append(index)
          probabilities = torch.sigmoid(pred).tolist()
      else:
          classes = torch.argmax(pred, -1).tolist()
          probabilities = torch.softmax(pred, -1).tolist()
  
      if self._labels is not None:
          if self.multi_label:
              classifications = []
              for idx in classes:
                  fo_cls = fol.Classification(
                      label=self._labels[idx],
                      confidence=probabilities[idx],
                  )
                  classifications.append(fo_cls)
              fo_predictions = fol.Classifications(
                  classifications=classifications,
                  logits=logits,
              )
          else:
              confidence = max(probabilities)
              if (
                  self.threshold is not None
                  and confidence < self.threshold
              ):
                  fo_predictions = None
              else:
                  fo_predictions = fol.Classification(
                      label=self._labels[classes],
                      confidence=confidence,
                      logits=logits,
                  )
      else:
          rank_zero_warn(
              "No labels were provided, int targets will be used as label strings.",
              category=UserWarning,
          )
  
          if self.multi_label:
              classifications = []
              for idx in classes:
                  fo_cls = fol.Classification(
                      label=str(idx),
                      confidence=probabilities[idx],
                  )
                  classifications.append(fo_cls)
              fo_predictions = fol.Classifications(
                  classifications=classifications,
                  logits=logits,
              )
          else:
              confidence = max(probabilities)
              if (
                  self.threshold is not None
                  and confidence < self.threshold
              ):
                  fo_predictions = None
              else:
                  fo_predictions = fol.Classification(
                      label=str(classes),
                      confidence=confidence,
                      logits=logits,
                  )
  
      if self.return_filepath:
          filepath = sample[DataKeys.METADATA]["filepath"]
          return {"filepath": filepath, "predictions": fo_predictions}
      return fo_predictions
  
imports: from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Union
  import torch
  import torch.nn.functional
  from pytorch_lightning.utilities import rank_zero_warn
  from torch import Tensor
  from torchmetrics import Accuracy, F1Score, Metric
  from flash.core.adapter import AdapterTask
  from flash.core.data.io.input import DataKeys
  from flash.core.data.io.output import Output
  from flash.core.model import Task
  from flash.core.registry import FlashRegistry
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, lazy_import, requires
  from flash.core.utilities.providers import _FIFTYONE
label_desc: Use image node_id 3 for calling the FiftyOneLabelsOutput obj's underlying member method code with example usage: obj.transform(sample) and returns: fo_predictions, dict