code: def _detection_to_bdd(detection, frame_size, extra_attrs):
      width, height = frame_size
      x, y, w, h = detection.bounding_box
  
      box2d = {
          "x1": round(x * width, 1),
          "x2": round((x + w) * width, 1),
          "y1": round(y * height, 1),
          "y2": round((y + h) * height, 1),
      }
  
      attributes = _get_attributes(detection, extra_attrs)
  
      d = {
          "id": None,
          "category": detection.label,
          "manualAttributes": True,
          "manualShape": True,
          "attributes": attributes,
          "box2d": box2d,
      }
  
      if detection.confidence is not None:
          d["score"] = detection.confidence
  
      return d
  
imports: from copy import deepcopy
  import logging
  import os
  import warnings
  import eta.core.serial
  import eta.core.utils
  import fiftyone
  import fiftyone.core.labels
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.utils.data
label_desc: Use image node_id 13 for calling a global function with example usage: _detection_to_bdd(detection, frame_size, extra_attrs) and returns: d