def add_images(
    dataset,
    samples,
    sample_parser,
    tags=None,
    generator=False,
    progress=None,
):
    """Adds the given images to the dataset.

    This operation does not read the images.

    See :ref:`this guide <custom-sample-parser>` for more details about
    adding images to a dataset by defining your own
    :class:`UnlabeledImageSampleParser`.

    Args:
        dataset: a :class:`fiftyone.core.dataset.Dataset`
        samples: an iterable of samples that can be parsed by ``sample_parser``
        sample_parser: a :class:`UnlabeledImageSampleParser` instance to use to
            parse the samples
        tags (None): an optional tag or iterable of tags to attach to each
            sample
        generator (False): whether to yield ID batches as a generator as
            samples are added to the dataset
        progress (None): whether to render a progress bar (True/False), use the
            default value ``fiftyone.config.show_progress_bars`` (None), or a
            progress callback function to invoke instead

    Returns:
        a list of IDs of the samples that were added to the dataset
    """
    if not sample_parser.has_image_path:
        raise ValueError(
            "Sample parser must have `has_image_path == True` to add its "
            "samples to the dataset"
        )

    if not isinstance(sample_parser, UnlabeledImageSampleParser):
        raise ValueError(
            "`sample_parser` must be a subclass of %s; found %s"
            % (
                etau.get_class_name(UnlabeledImageSampleParser),
                etau.get_class_name(sample_parser),
            )
        )

    if etau.is_str(tags):
        tags = [tags]
    elif tags is not None:
        tags = list(tags)

    def parse_sample(sample):
        sample_parser.with_sample(sample)

        image_path = sample_parser.get_image_path()

        if sample_parser.has_image_metadata:
            metadata = sample_parser.get_image_metadata()
        else:
            metadata = None

        return Sample(filepath=image_path, metadata=metadata, tags=tags)

    _samples = map(parse_sample, samples)
    return dataset.add_samples(
        _samples,
        expand_schema=False,
        generator=generator,
        progress=progress,
        num_samples=samples,
    )
Adds the given images to the dataset.

    This operation does not read the images.

    See :ref:`this guide <custom-sample-parser>` for more details about
    adding images to a dataset by defining your own
    :class:`UnlabeledImageSampleParser`.

    Args:
        dataset: a :class:`fiftyone.core.dataset.Dataset`
        samples: an iterable of samples that can be parsed by ``sample_parser``
        sample_parser: a :class:`UnlabeledImageSampleParser` instance to use to
            parse the samples
        tags (None): an optional tag or iterable of tags to attach to each
            sample
        generator (False): whether to yield ID batches as a generator as
            samples are added to the dataset
        progress (None): whether to render a progress bar (True/False), use the
            default value ``fiftyone.config.show_progress_bars`` (None), or a
            progress callback function to invoke instead

    Returns:
        a list of IDs of the samples that were added to the dataset
    
fiftyone/utils/data/parsers.py