class_docstr: A :class:`.Output` which converts model outputs to FiftyOne detection format.
  
  Args:
      labels: A list of labels, assumed to map the class index to the label for that class.
      threshold: a score threshold to apply to candidate detections.
      return_filepath: Boolean determining whether to return a dict
          containing filepath and FiftyOne labels (True) or only a
          list of FiftyOne labels (False)
class_docstr_tok: ["A",":","class",":","`",".Output","`","which","converts","model","outputs","to","FiftyOne","detection","format",".","Args",":","labels",":","A","list","of","labels",",","assumed","to","map","the","class","index","to","the","label","for","that","class",".","threshold",":","a","score","threshold","to","apply","to","candidate","detections",".","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 from_task(cls, task: Task, **kwargs) -> Output:
      return cls(labels=getattr(task, "labels", None))
  
file_path: lightning-flash/src/flash/image/detection/output.py
imports: from typing import Any, Dict, List, Optional, Union
  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 2 for calling the FiftyOneDetectionLabelsOutput obj's underlying member method code with example usage: obj.from_task(cls, task) and returns: cls