class_docstr: Exporter that writes YOLOv4 datasets to disk.
  
  See :ref:`this page <YOLOv4Dataset-export>` for format details.
  
  Args:
      export_dir (None): the directory to write the export. This has no
          effect if ``data_path``, ``objects_path``, and ``images_path`` are
          absolute paths
      data_path (None): an optional parameter that enables explicit control
          over the location of the exported data and labels. Can be any of
          the following:
  
          -   a folder name like ``"data"`` or ``"data/"`` specifying a
              subfolder of ``export_dir`` in which to export the data and
              labels
          -   an absolute directory path in which to export the data and
              labels. In this case, the ``export_dir`` has no effect on the
              location of the data
  
          If None, the data will be written into ``export_dir`` using the
          default folder name
      labels_path (None): an optional parameter that enables explicit
          control over the location of the exported labels. Can be any of the
          following:
  
          -   a folder name like ``"labels"`` or ``"labels/"`` specifying the
              location in ``export_dir`` in which to export the labels
          -   an absolute folder path to which to export the labels. In this
              case, the ``export_dir`` has no effect on the location of
              the labels
  
          If None, the labels will be written into the same directory as the
          exported media
      objects_path (None): an optional parameter that enables explicit
          control over the location of the object names file. Can be any of
          the following:
  
          -   a filename like ``"obj.names"`` specifying the location in
              ``export_dir`` in which to export the object names
          -   an absolute filepath to which to export the object names. In
              this case, the ``export_dir`` has no effect on the location of
              the object names
  
          If None, the object names will be written into ``export_dir``
          using the default filename, unless no media is being exported, in
          which case this file will not be written
      images_path (None): an optional parameter that enables explicit control
          over the location of the image listing file. Can be any of the
          following:
  
          -   a filename like ``"images.txt"`` specifying the location in
              ``export_dir`` in which to export the image listing
          -   an absolute filepath to which to export the image listing. In
              this case, the ``export_dir`` has no effect on the location of
              the image listing
  
          If None, the image listing will be written into ``export_dir``
          using the default filename, unless no media is being exported, in
          which case this file will not be written
      export_media (None): controls how to export the raw media. The
          supported values are:
  
          -   ``True``: copy all media files into the output directory
          -   ``False``: don't export media
          -   ``"move"``: move all media files into the output directory
          -   ``"symlink"``: create symlinks to the media files in the output
              directory
  
          If None, the default value of this parameter will be chosen based
          on the value of the ``data_path`` parameter
      rel_dir (None): an optional relative directory to strip from each input
          filepath to generate a unique identifier for each image. When
          exporting media, this identifier is joined with ``data_path`` and
          ``labels_path`` to generate output paths for each exported image
          and labels file. This argument allows for populating nested
          subdirectories that match the shape of the input paths. The path is
          converted to an absolute path (if necessary) via
          :func:`fiftyone.core.storage.normalize_path`
      classes (None): the list of possible class labels
      include_confidence (False): whether to include detection confidences in
          the export, if they exist
      image_format (None): the image format to use when writing in-memory
          images to disk. By default, ``fiftyone.config.default_image_ext``
          is used
class_docstr_tok: ["Exporter","that","writes","YOLOv4","datasets","to","disk",".","See",":","ref",":","`","this","page","<","YOLOv4Dataset-export",">","`","for","format","details",".","Args",":","export_dir","(","None",")",":","the","directory","to","write","the","export",".","This","has","no","effect","if","``","data_path","``",",","``","objects_path","``",",","and","``","images_path","``","are","absolute","paths","data_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","exported","data","and","labels",".","Can","be","any","of","the","following",":","-","a","folder","name","like","``","``","data","''","``","or","``","``","data\/","''","``","specifying","a","subfolder","of","``","export_dir","``","in","which","to","export","the","data","and","labels","-","an","absolute","directory","path","in","which","to","export","the","data","and","labels",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","data","If","None",",","the","data","will","be","written","into","``","export_dir","``","using","the","default","folder","name","labels_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","exported","labels",".","Can","be","any","of","the","following",":","-","a","folder","name","like","``","``","labels","''","``","or","``","``","labels\/","''","``","specifying","the","location","in","``","export_dir","``","in","which","to","export","the","labels","-","an","absolute","folder","path","to","which","to","export","the","labels",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","labels","If","None",",","the","labels","will","be","written","into","the","same","directory","as","the","exported","media","objects_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","object","names","file",".","Can","be","any","of","the","following",":","-","a","filename","like","``","``","obj.names","''","``","specifying","the","location","in","``","export_dir","``","in","which","to","export","the","object","names","-","an","absolute","filepath","to","which","to","export","the","object","names",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","object","names","If","None",",","the","object","names","will","be","written","into","``","export_dir","``","using","the","default","filename",",","unless","no","media","is","being","exported",",","in","which","case","this","file","will","not","be","written","images_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","image","listing","file",".","Can","be","any","of","the","following",":","-","a","filename","like","``","``","images.txt","''","``","specifying","the","location","in","``","export_dir","``","in","which","to","export","the","image","listing","-","an","absolute","filepath","to","which","to","export","the","image","listing",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","image","listing","If","None",",","the","image","listing","will","be","written","into","``","export_dir","``","using","the","default","filename",",","unless","no","media","is","being","exported",",","in","which","case","this","file","will","not","be","written","export_media","(","None",")",":","controls","how","to","export","the","raw","media",".","The","supported","values","are",":","-","``","True","``",":","copy","all","media","files","into","the","output","directory","-","``","False","``",":","do","n't","export","media","-","``","``","move","''","``",":","move","all","media","files","into","the","output","directory","-","``","``","symlink","''","``",":","create","symlinks","to","the","media","files","in","the","output","directory","If","None",",","the","default","value","of","this","parameter","will","be","chosen","based","on","the","value","of","the","``","data_path","``","parameter","rel_dir","(","None",")",":","an","optional","relative","directory","to","strip","from","each","input","filepath","to","generate","a","unique","identifier","for","each","image",".","When","exporting","media",",","this","identifier","is","joined","with","``","data_path","``","and","``","labels_path","``","to","generate","output","paths","for","each","exported","image","and","labels","file",".","This","argument","allows","for","populating","nested","subdirectories","that","match","the","shape","of","the","input","paths",".","The","path","is","converted","to","an","absolute","path","(","if","necessary",")","via",":","func",":","`","fiftyone.core.storage.normalize_path","`","classes","(","None",")",":","the","list","of","possible","class","labels","include_confidence","(","False",")",":","whether","to","include","detection","confidences","in","the","export",",","if","they","exist","image_format","(","None",")",":","the","image","format","to","use","when","writing","in-memory","images","to","disk",".","By","default",",","``","fiftyone.config.default_image_ext","``","is","used"]
code: def setup(self):
      self._classes = {}
      self._labels_map_rev = {}
      self._rel_dir = os.path.dirname(self.images_path)
      self._images = []
      self._writer = YOLOAnnotationWriter()
  
      self._parse_classes()
  
      export_path = (
          self.data_path if self.export_media != False else None
      )
      self._media_exporter = foud.ImageExporter(
          self.export_media,
          export_path=export_path,
          rel_dir=self.rel_dir,
          supported_modes=(True, False, "move", "symlink"),
          default_ext=self.image_format,
          ignore_exts=True,
      )
      self._media_exporter.setup()
  
imports: import logging
  import os
  import warnings
  import yaml
  import eta.core.utils
  import fiftyone.core.labels
  import fiftyone.core.storage
  import fiftyone.utils.data
label_desc: Use image node_id 4 for calling the YOLOv4DatasetExporter obj's underlying member method code with example usage: obj.setup() without return types