class_docstr: An object in VOC detection format.
  
  Args:
      name: the object label
      bndbox: a :class:`VOCBoundingBox`
      **attributes: additional custom attributes
class_docstr_tok: ["An","object","in","VOC","detection","format",".","Args",":","name",":","the","object","label","bndbox",":","a",":","class",":","`","VOCBoundingBox","`","*","*","attributes",":","additional","custom","attributes"]
docstr: Returns a :class:`fiftyone.core.labels.Detection` representation of
  the object.
  
  Args:
      frame_size: the ``(width, height)`` of the image
      extra_attrs (True): whether to include extra annotation attributes
          on the object. Supported values are:
  
          -   ``True``: include all extra attributes found
          -   ``False``: do not include extra attributes
          -   a name or list of names of specific attributes to include
  
  Returns:
      a :class:`fiftyone.core.labels.Detection`
docstr_tok: ["Returns","a",":","class",":","`","fiftyone.core.labels.Detection","`","representation","of","the","object",".","Args",":","frame_size",":","the","``","(","width",",","height",")","``","of","the","image","extra_attrs","(","True",")",":","whether","to","include","extra","annotation","attributes","on","the","object",".","Supported","values","are",":","-","``","True","``",":","include","all","extra","attributes","found","-","``","False","``",":","do","not","include","extra","attributes","-","a","name","or","list","of","names","of","specific","attributes","to","include","Returns",":","a",":","class",":","`","fiftyone.core.labels.Detection","`"]
code: def to_detection(self, frame_size, extra_attrs=True):
      """Returns a :class:`fiftyone.core.labels.Detection` representation of
      the object.
  
      Args:
          frame_size: the ``(width, height)`` of the image
          extra_attrs (True): whether to include extra annotation attributes
              on the object. Supported values are:
  
              -   ``True``: include all extra attributes found
              -   ``False``: do not include extra attributes
              -   a name or list of names of specific attributes to include
  
      Returns:
          a :class:`fiftyone.core.labels.Detection`
      """
      label = self.name
      bounding_box = self.bndbox.to_detection_format(frame_size)
  
      if extra_attrs == True:
          attributes = self.attributes
      elif extra_attrs == False:
          attributes = {}
      else:
          if etau.is_str(extra_attrs):
              extra_attrs = [extra_attrs]
  
          attributes = {
              name: self.attributes.get(name, None)
              for name in extra_attrs
          }
  
      return fol.Detection(
          label=label, bounding_box=bounding_box, **attributes
      )
  
imports: import logging
  import os
  import jinja2
  import eta.core.utils
  import fiftyone.constants
  import fiftyone.core.labels
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.utils.data
label_desc: Use image node_id 4 for calling the VOCObject obj's underlying member method code with example usage: obj.to_detection(frame_size, extra_attrs) and returns: fol