class_docstr: Exporter that writes YOLOv5 datasets to disk.
  
  See :ref:`this page <YOLOv5Dataset-export>` for format details.
  
  Args:
      export_dir (None): the directory to write the export. This has no
          effect if ``data_path``, ``labels_path``, and ``yaml_path`` are
          absolute paths
      split ("val"): the split being exported. Typical values are
          ``("train", "val")``
      data_path (None): an optional parameter that enables explicit control
          over the location of the exported media. Can be any of the
          following:
  
          -   a folder name like ``"images"`` or ``"images/"`` specifying a
              subfolder of ``export_dir`` in which to export the images
          -   an absolute directory path in which to export the images. In
              this case, the ``export_dir`` has no effect on the location of
              the images
  
          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 ``export_dir`` using the
          default folder name
      yaml_path (None): an optional parameter that enables explicit control
          over the location of the dataset YAML file. Can be any of the
          following:
  
          -   a filename like ``"dataset.yaml"`` specifying the location in
              ``export_dir`` to write the YAML file
          -   an absolute filepath to which to write the YAML file. In this
              case, the ``export_dir`` has no effect on the location of
              the image listing
  
          If None, the dataset YAML file 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
      include_path (True): whether to include the directory name containing
          the YAML file in the ``path`` key of the exported YAML
class_docstr_tok: ["Exporter","that","writes","YOLOv5","datasets","to","disk",".","See",":","ref",":","`","this","page","<","YOLOv5Dataset-export",">","`","for","format","details",".","Args",":","export_dir","(","None",")",":","the","directory","to","write","the","export",".","This","has","no","effect","if","``","data_path","``",",","``","labels_path","``",",","and","``","yaml_path","``","are","absolute","paths","split","(","``","val","''",")",":","the","split","being","exported",".","Typical","values","are","``","(","``","train","''",",","``","val","''",")","``","data_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","exported","media",".","Can","be","any","of","the","following",":","-","a","folder","name","like","``","``","images","''","``","or","``","``","images\/","''","``","specifying","a","subfolder","of","``","export_dir","``","in","which","to","export","the","images","-","an","absolute","directory","path","in","which","to","export","the","images",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","images","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","``","export_dir","``","using","the","default","folder","name","yaml_path","(","None",")",":","an","optional","parameter","that","enables","explicit","control","over","the","location","of","the","dataset","YAML","file",".","Can","be","any","of","the","following",":","-","a","filename","like","``","``","dataset.yaml","''","``","specifying","the","location","in","``","export_dir","``","to","write","the","YAML","file","-","an","absolute","filepath","to","which","to","write","the","YAML","file",".","In","this","case",",","the","``","export_dir","``","has","no","effect","on","the","location","of","the","image","listing","If","None",",","the","dataset","YAML","file","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","include_path","(","True",")",":","whether","to","include","the","directory","name","containing","the","YAML","file","in","the","``","path","``","key","of","the","exported","YAML"]
code: def __init__(
      self,
      export_dir=None,
      split="val",
      data_path=None,
      labels_path=None,
      yaml_path=None,
      export_media=None,
      rel_dir=None,
      classes=None,
      include_confidence=False,
      image_format=None,
      include_path=True,
  ):
      data_path, export_media = self._parse_data_path(
          export_dir=export_dir,
          data_path=data_path,
          export_media=export_media,
          default="images/" + split,
      )
  
      labels_path = self._parse_labels_path(
          export_dir=export_dir,
          labels_path=labels_path,
          default="labels/" + split,
      )
  
      yaml_path = self._parse_labels_path(
          export_dir=export_dir,
          labels_path=yaml_path,
          default="dataset.yaml",
      )
  
      super().__init__(export_dir=export_dir)
  
      self.split = split
      self.data_path = data_path
      self.labels_path = labels_path
      self.yaml_path = yaml_path
      self.export_media = export_media
      self.rel_dir = rel_dir
      self.classes = classes
      self.include_confidence = include_confidence
      self.image_format = image_format
      self.include_path = include_path
  
      self._classes = None
      self._dynamic_classes = classes is None
      self._labels_map_rev = None
      self._rel_dir = None
      self._images = None
      self._writer = None
      self._media_exporter = None
  
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 1 to create a new YOLOv5DatasetExporter object from inherited base classes: foud, foud with example: obj = YOLOv5DatasetExporter(export_dir, split, data_path, labels_path, yaml_path, export_media, rel_dir, classes, include_confidence, image_format, include_path)