def parse_cityscapes_dataset(
    source_dir,
    dataset_dir,
    scratch_dir,
    splits,
    fine_annos=None,
    coarse_annos=None,
    person_annos=None,
):
    """Parses the Cityscapes archive(s) in the specified directory and writes
    the requested splits in subdirectories of ``dataset_dir`` in
    :class:`fiftyone.types.FiftyOneDataset` format.

    The archives must have been manually downloaded into the directory before
    this method is called.

    The ``source_dir`` should contain the following files::

        source_dir/
            leftImg8bit_trainvaltest.zip
            gtFine_trainvaltest.zip             # optional
            gtCoarse.zip                        # optional
            gtBbox_cityPersons_trainval.zip     # optional

    Args:
        source_dir: the directory continaining the manually downloaded
            Cityscapes files
        dataset_dir: the directory in which to build the output dataset
        scratch_dir: a scratch directory to use for temporary files
        splits: a list of splits to parse. Supported values are
            ``(train, test, validation)``
        fine_annos (None): whether to load the fine annotations (True), or not
            (False), or only if the ZIP file exists (None)
        coarse_annos (None): whether to load the coarse annotations (True), or
            not (False), or only if the ZIP file exists (None)
        person_annos (None): whether to load the personn detections (True), or
            not (False), or only if the ZIP file exists (None)

    Raises:
        OSError: if any required source files are not present
    """
    (
        images_zip_path,
        fine_annos_zip_path,
        coarse_annos_zip_path,
        person_annos_zip_path,
    ) = _parse_source_dir(source_dir, fine_annos, coarse_annos, person_annos)

    _splits = [_parse_split(s) for s in splits]

    images_dir = _extract_images(images_zip_path, scratch_dir)

    if fine_annos_zip_path:
        fine_annos_dir = _extract_fine_annos(fine_annos_zip_path, scratch_dir)
    else:
        fine_annos_dir = None

    if coarse_annos_zip_path:
        coarse_annos_dir = _extract_coarse_annos(
            coarse_annos_zip_path, scratch_dir
        )
    else:
        coarse_annos_dir = None

    if person_annos_zip_path:
        person_annos_dir = _extract_person_annos(
            person_annos_zip_path, scratch_dir
        )
    else:
        person_annos_dir = None

    for split, _split in zip(splits, _splits):
        split_dir = os.path.join(dataset_dir, split)
        _export_split(
            _split,
            split_dir,
            images_dir,
            fine_annos_dir,
            coarse_annos_dir,
            person_annos_dir,
        )
Parses the Cityscapes archive(s) in the specified directory and writes
    the requested splits in subdirectories of ``dataset_dir`` in
    :class:`fiftyone.types.FiftyOneDataset` format.

    The archives must have been manually downloaded into the directory before
    this method is called.

    The ``source_dir`` should contain the following files::

        source_dir/
            leftImg8bit_trainvaltest.zip
            gtFine_trainvaltest.zip             # optional
            gtCoarse.zip                        # optional
            gtBbox_cityPersons_trainval.zip     # optional

    Args:
        source_dir: the directory continaining the manually downloaded
            Cityscapes files
        dataset_dir: the directory in which to build the output dataset
        scratch_dir: a scratch directory to use for temporary files
        splits: a list of splits to parse. Supported values are
            ``(train, test, validation)``
        fine_annos (None): whether to load the fine annotations (True), or not
            (False), or only if the ZIP file exists (None)
        coarse_annos (None): whether to load the coarse annotations (True), or
            not (False), or only if the ZIP file exists (None)
        person_annos (None): whether to load the personn detections (True), or
            not (False), or only if the ZIP file exists (None)

    Raises:
        OSError: if any required source files are not present
    
fiftyone/utils/cityscapes.py