class_docstr: Converts Ultralytics PyTorch Hub model outputs to FiftyOne format.
class_docstr_tok: ["Converts","Ultralytics","PyTorch","Hub","model","outputs","to","FiftyOne","format","."]
code: def _to_detections(self, df):
      return fol.Detections(
          detections=[
              fol.Detection(
                  label=row.name,
                  bounding_box=[
                      row.xcenter - 0.5 * row.width,
                      row.ycenter - 0.5 * row.height,
                      row.width,
                      row.height,
                  ],
                  confidence=row.confidence,
              )
              for row in df.itertuples()
          ]
      )
  
imports: import itertools
  import numpy
  from PIL import Image
  from fiftyone.core.config import Config
  import fiftyone.core.labels
  from fiftyone.core.models import Model
  import fiftyone.utils.torch
  import fiftyone.core.utils
label_desc: Use image node_id 2 for calling the UltralyticsOutputProcessor obj's underlying member method code with example usage: obj._to_detections(df) and returns: fol