def from_video_labels(
    video_labels_or_path,
    prefix=None,
    labels_dict=None,
    frame_labels_dict=None,
    multilabel=False,
    skip_non_categorical=False,
):
    """Loads the ``eta.core.video.VideoLabels`` into a frame labels dictionary.

    Args:
        video_labels_or_path: can be a ``eta.core.video.VideoLabels`` instance,
            a serialized dict representation of one, or the path to one on disk
        prefix (None): a string prefix to prepend to each label name in the
            expanded sample/frame label dictionaries
        labels_dict (None): a dictionary mapping names of attributes/objects
            in the sample labels to field names into which to expand them. By
            default, all sample labels are loaded
        frame_labels_dict (None): a dictionary mapping names of
            attributes/objects in the frame labels to field names into which to
            expand them. By default, all frame labels are loaded
        multilabel (False): whether to store attributes in a single
            :class:`fiftyone.core.labels.Classifications` instance
        skip_non_categorical (False): whether to skip non-categorical
            attributes (True) or cast them to strings (False)

    Returns:
        a tuple of

        -   **label**: a dict mapping sample field names to
            :class:`fiftyone.core.labels.Label` instances
        -   **frames**: a dict mapping frame numbers to dicts that map label
            fields to :class:`fiftyone.core.labels.Label` instances
    """
    if etau.is_str(video_labels_or_path):
        video_labels = etav.VideoLabels.from_json(video_labels_or_path)
    elif isinstance(video_labels_or_path, dict):
        video_labels = etav.VideoLabels.from_dict(video_labels_or_path)
    else:
        video_labels = video_labels_or_path

    if video_labels is None:
        return None, None

    # Video labels
    if (
        video_labels.has_video_attributes or video_labels.has_video_events
    ) and (labels_dict is None or labels_dict):
        if labels_dict is not None:
            label = _expand_with_labels_dict(
                video_labels, labels_dict, multilabel, skip_non_categorical
            )
        else:
            label = _expand_with_prefix(
                video_labels, prefix, multilabel, skip_non_categorical
            )
    else:
        label = None

    # Frame labels
    if video_labels.frames and (
        frame_labels_dict is None or frame_labels_dict
    ):
        frames = {}
        for frame_number in video_labels:
            frames[frame_number] = from_image_labels(
                video_labels[frame_number],
                prefix=prefix,
                labels_dict=frame_labels_dict,
                multilabel=multilabel,
                skip_non_categorical=skip_non_categorical,
            )
    else:
        frames = None

    return label, frames
Loads the ``eta.core.video.VideoLabels`` into a frame labels dictionary.

    Args:
        video_labels_or_path: can be a ``eta.core.video.VideoLabels`` instance,
            a serialized dict representation of one, or the path to one on disk
        prefix (None): a string prefix to prepend to each label name in the
            expanded sample/frame label dictionaries
        labels_dict (None): a dictionary mapping names of attributes/objects
            in the sample labels to field names into which to expand them. By
            default, all sample labels are loaded
        frame_labels_dict (None): a dictionary mapping names of
            attributes/objects in the frame labels to field names into which to
            expand them. By default, all frame labels are loaded
        multilabel (False): whether to store attributes in a single
            :class:`fiftyone.core.labels.Classifications` instance
        skip_non_categorical (False): whether to skip non-categorical
            attributes (True) or cast them to strings (False)

    Returns:
        a tuple of

        -   **label**: a dict mapping sample field names to
            :class:`fiftyone.core.labels.Label` instances
        -   **frames**: a dict mapping frame numbers to dicts that map label
            fields to :class:`fiftyone.core.labels.Label` instances
    
fiftyone/utils/eta.py