def apply_model(
        self,
        model,
        label_field="predictions",
        confidence_thresh=None,
        store_logits=False,
        batch_size=None,
        num_workers=None,
        skip_failures=True,
        output_dir=None,
        rel_dir=None,
        progress=None,
        **kwargs,
    ):
        """Applies the model to the samples in the collection.

        This method supports all of the following cases:

        -   Applying an image model to an image collection
        -   Applying an image model to the frames of a video collection
        -   Applying a video model to a video collection

        Args:
            model: a :class:`fiftyone.core.models.Model`, Hugging Face
                transformers model, Ultralytics model, SuperGradients model, or
                Lightning Flash model
            label_field ("predictions"): the name of the field in which to
                store the model predictions. When performing inference on video
                frames, the "frames." prefix is optional
            confidence_thresh (None): an optional confidence threshold to apply
                to any applicable labels generated by the model
            store_logits (False): whether to store logits for the model
                predictions. This is only supported when the provided ``model``
                has logits, ``model.has_logits == True``
            batch_size (None): an optional batch size to use, if the model
                supports batching
            num_workers (None): the number of workers for the
                :class:`torch:torch.utils.data.DataLoader` to use. Only
                applicable for Torch-based models
            skip_failures (True): whether to gracefully continue without
                raising an error if predictions cannot be generated for a
                sample. Only applicable to :class:`fiftyone.core.models.Model`
                instances
            output_dir (None): an optional output directory in which to write
                segmentation images. Only applicable if the model generates
                segmentations. If none is provided, the segmentations are
                stored in the database
            rel_dir (None): an optional relative directory to strip from each
                input filepath to generate a unique identifier that is joined
                with ``output_dir`` to generate an output path for each
                segmentation image. This argument allows for populating nested
                subdirectories in ``output_dir`` 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`
            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
            **kwargs: optional model-specific keyword arguments passed through
                to the underlying inference implementation
        """
        fomo.apply_model(
            self,
            model,
            label_field=label_field,
            confidence_thresh=confidence_thresh,
            store_logits=store_logits,
            batch_size=batch_size,
            num_workers=num_workers,
            skip_failures=skip_failures,
            output_dir=output_dir,
            rel_dir=rel_dir,
            progress=progress,
            **kwargs,
        )
Applies the model to the samples in the collection.

        This method supports all of the following cases:

        -   Applying an image model to an image collection
        -   Applying an image model to the frames of a video collection
        -   Applying a video model to a video collection

        Args:
            model: a :class:`fiftyone.core.models.Model`, Hugging Face
                transformers model, Ultralytics model, SuperGradients model, or
                Lightning Flash model
            label_field ("predictions"): the name of the field in which to
                store the model predictions. When performing inference on video
                frames, the "frames." prefix is optional
            confidence_thresh (None): an optional confidence threshold to apply
                to any applicable labels generated by the model
            store_logits (False): whether to store logits for the model
                predictions. This is only supported when the provided ``model``
                has logits, ``model.has_logits == True``
            batch_size (None): an optional batch size to use, if the model
                supports batching
            num_workers (None): the number of workers for the
                :class:`torch:torch.utils.data.DataLoader` to use. Only
                applicable for Torch-based models
            skip_failures (True): whether to gracefully continue without
                raising an error if predictions cannot be generated for a
                sample. Only applicable to :class:`fiftyone.core.models.Model`
                instances
            output_dir (None): an optional output directory in which to write
                segmentation images. Only applicable if the model generates
                segmentations. If none is provided, the segmentations are
                stored in the database
            rel_dir (None): an optional relative directory to strip from each
                input filepath to generate a unique identifier that is joined
                with ``output_dir`` to generate an output path for each
                segmentation image. This argument allows for populating nested
                subdirectories in ``output_dir`` 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`
            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
            **kwargs: optional model-specific keyword arguments passed through
                to the underlying inference implementation
        
fiftyone/core/collections.py